Skip to content

Commit

Permalink
fix: get commit sha failed in translate action (langgenius#7959)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjoel authored and lau-td committed Oct 23, 2024
1 parent 975a0cf commit 0fe66d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/translate-i18n-base-on-english.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 2 # last 2 commits

- name: Check for file changes in i18n/en-US
id: check_files
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"
if [ -n "$changed_files" ]; then
echo "FILES_CHANGED=true" >> $GITHUB_ENV
Expand Down

0 comments on commit 0fe66d3

Please sign in to comment.