2023-10-20 10:44:58 -04:00
|
|
|
name: Daily TX Pull
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
|
|
|
|
schedule:
|
|
|
|
# daily-tx-pull (e.g., daily at 3 AM UTC)
|
|
|
|
- cron: "0 3 * * *"
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "${{ github.workflow }}"
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write # publish a GitHub release
|
|
|
|
pages: write # deploy to GitHub Pages
|
|
|
|
issues: write # comment on released issues
|
|
|
|
pull-requests: write # comment on released pull requests
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
daily-tx-pull:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-11-22 14:00:42 -05:00
|
|
|
outputs:
|
|
|
|
MADE_CHANGES: ${{ steps.commit.outputs.MADE_CHANGES }}
|
|
|
|
|
2023-10-20 10:44:58 -04:00
|
|
|
env:
|
|
|
|
# Organization-wide secrets
|
|
|
|
TX_TOKEN: ${{ secrets.TX_TOKEN }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: "npm"
|
|
|
|
node-version-file: ".nvmrc"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Pull editor and www translations
|
|
|
|
run: |
|
|
|
|
npm run pull:editor
|
|
|
|
npm run pull:www
|
|
|
|
npm run test
|
|
|
|
|
|
|
|
- name: Commit translation updates
|
2023-11-20 10:55:58 -05:00
|
|
|
id: commit
|
2023-10-20 10:44:58 -04:00
|
|
|
run: |
|
|
|
|
git config --global user.email $(git log --pretty=format:"%ae" -n1)
|
|
|
|
git config --global user.name $(git log --pretty=format:"%an" -n1)
|
|
|
|
git add .
|
|
|
|
if git diff --cached --exit-code --quiet; then
|
2023-11-20 10:55:58 -05:00
|
|
|
echo "MADE_CHANGES=false" >> "$GITHUB_OUTPUT"
|
2023-10-20 10:44:58 -04:00
|
|
|
echo "Nothing to commit."
|
|
|
|
else
|
2023-12-20 15:09:33 -05:00
|
|
|
git commit -m "fix: pull new editor translations from Transifex"
|
2023-11-20 10:55:58 -05:00
|
|
|
echo "MADE_CHANGES=true" >> "$GITHUB_OUTPUT"
|
2023-11-22 14:37:15 -05:00
|
|
|
git push
|
2023-10-20 10:44:58 -04:00
|
|
|
fi
|
2023-11-22 14:00:42 -05:00
|
|
|
call-ci-cd:
|
|
|
|
needs: daily-tx-pull
|
|
|
|
if: needs.daily-tx-pull.outputs.MADE_CHANGES == 'true'
|
2023-11-27 16:55:49 -05:00
|
|
|
uses: ./.github/workflows/ci-cd.yml
|
|
|
|
secrets: inherit
|