Skip to content

Commit 9b3801a

Browse files
committed
Update GitHub Actions workflow to handle pull request refs and push changes accordingly
1 parent 9275b37 commit 9b3801a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/update-translation-stats.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14+
with:
15+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
16+
fetch-depth: 0
1417

1518
- name: Set up Python
1619
uses: actions/setup-python@v4
@@ -45,9 +48,10 @@ jobs:
4548
run: python scripts/transifex/update_readme.py
4649

4750
- name: Commit and push changes
51+
if: ${{ github.event_name != 'pull_request' }}
4852
run: |
4953
git config --local user.email "github-actions@github.com"
5054
git config --local user.name "GitHub Action"
5155
git add reports/ README.md
5256
git diff --quiet && git diff --staged --quiet || git commit -m "Update translation statistics"
53-
git push
57+
git push origin ${{ github.ref_name }}

0 commit comments

Comments
 (0)