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 22, 2024
1 parent 5161db1 commit 2cdb044
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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,12 @@ jobs:
if: |
${{ env.LOCALS_JS_IS_CHANGED == 'true' }}
run: |
# 获取最后一次提交中`locals.js`的文件时间
locals_js_time=$(git log -1 --format=%at -- locals.js)
# 使用`locals.js`的文件日期为词库版本号
locals_js_date=$(TZ='Asia/Shanghai' date -d "$(stat -c %y locals.js)" +'%Y-%m-%d')
locals_js_date=$(TZ='Asia/Shanghai' date -d "@$locals_js_time" +'%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-$locals_js_date/" main.user.js
git diff --quiet --exit-code main.user.js || \
Expand Down

0 comments on commit 2cdb044

Please sign in to comment.