Skip to content

Commit

Permalink
GA:更新开发版词库版本号逻辑,使用词库locals.js的文件日期
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Jul 21, 2024
1 parent 5174d41 commit 7c1e8d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/main.user.js_version_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ jobs:
if: |
${{ env.LOCALS_JS_IS_CHANGED == 'true' }}
run: |
# 使用`locals.js`的文件日期为词库版本号
locals_js_date=$(TZ='Asia/Shanghai' date -d "$(stat -c %y locals.js)" +'%Y-%m-%d')
sed -i -E "s/(@version\s*[0-9]+\.[0-9]+\.[0-9]+)(-[0-9]{4}-[0-9]{2}-[0-9]{2})?/\
\1-$(TZ='Asia/Shanghai' date +'%Y-%m-%d')/" main.user.js
\1-$locals_js_date/" main.user.js
git diff --quiet --exit-code main.user.js || \
echo "MAIN_USER_JS_IS_CHANGED=true" >> $GITHUB_ENV
Expand Down

0 comments on commit 7c1e8d2

Please sign in to comment.