Skip to content

Commit

Permalink
Simplify by using a pre-built action
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr0grog committed Feb 21, 2025
1 parent 77de7c3 commit d4404df
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,25 +120,18 @@ jobs:
run: npm ci

- name: Extract English from source code
id: extract
if: github.event_name == 'pull_request'
run: |
git config user.email "[email protected]"
git config user.name "Translation Update Bot"
run: npm run intl:extract

ENGLISH_FILE='src/intl/en.json'
npm run intl:extract
if (git diff --exit-code "${ENGLISH_FILE}" > /dev/null); then
echo 'english-changed=' >> "${GITHUB_OUTPUT}"
else
echo 'english-changed=true' >> "${GITHUB_OUTPUT}"
git add "${ENGLISH_FILE}"
git commit -m 'Auto-update en.json from component source code'
git push
fi
- uses: stefanzweifel/git-auto-commit-action@v5
id: commit-strings
if: github.event_name == 'pull_request'
with:
commit_message: 'Auto-update en.json from component source code'
file_pattern: 'client/src/intl/en.json'

- if: github.event_name == 'pull_request' && steps.extract.outputs.english-changed == 'true'
uses: thollander/actions-comment-pull-request@v3
- uses: thollander/actions-comment-pull-request@v3
if: steps.commit-strings.outputs.changes_detected == 'true'
with:
message: |
:wave: FYI, your PR has been automatically updated with changes to
Expand Down

0 comments on commit d4404df

Please sign in to comment.