浏览代码

fix: get commit sha failed in translate action (#7959)

tags/0.8.0-beta1
Joel 1年前
父节点
当前提交
c2a3c5a748
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      .github/workflows/translate-i18n-base-on-english.yml

+ 4
- 2
.github/workflows/translate-i18n-base-on-english.yml 查看文件

steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0
fetch-depth: 2 # last 2 commits


- name: Check for file changes in i18n/en-US - name: Check for file changes in i18n/en-US
id: check_files id: check_files
run: | run: |
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- 'i18n/en-US/*.ts')
recent_commit_sha=$(git rev-parse HEAD)
second_recent_commit_sha=$(git rev-parse HEAD~1)
changed_files=$(git diff --name-only $recent_commit_sha $second_recent_commit_sha -- 'i18n/en-US/*.ts')
echo "Changed files: $changed_files" echo "Changed files: $changed_files"
if [ -n "$changed_files" ]; then if [ -n "$changed_files" ]; then
echo "FILES_CHANGED=true" >> $GITHUB_ENV echo "FILES_CHANGED=true" >> $GITHUB_ENV

正在加载...
取消
保存