Skip to content

Commit

Permalink
Remove unnecessary safety checks
Browse files Browse the repository at this point in the history
GitHub doesn’t run workflows for commits pushed from inside of Actions
  • Loading branch information
j-f1 committed Jan 3, 2023
1 parent 0152697 commit 23a1bca
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/localization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,7 @@ jobs:
run: exec ./.github/scripts/setup.sh
- name: Update localization files
run: exec ./update_localization.sh
- name: Check for changes
id: changes
run: |
git status --porcelain
if git diff --quiet; then
echo "No changes to commit. Skipping push."
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Avoid infinite loops
if: steps.changes.outputs.changes == 'true'
run: |
if git log -1 --pretty=%B | grep -q "Auto-update generated files"; then
echo "This commit was generated by the localization workflow. Exiting."
echo "::error::Localization files changed again after auto-update, failing now to avoid infinite loop."
exit 1
fi
- name: Commit and push changes
if: steps.changes.outputs.changes == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Auto-update generated files"
Expand Down

0 comments on commit 23a1bca

Please sign in to comment.