forked from DOI-DO/j40-cejst-2
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify by using a pre-built action
- Loading branch information
Showing
1 changed file
with
9 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|