Translation statistics #203
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
name: Translation statistics | |
# Pull statistics of translation in Transifex | |
on: | |
schedule: | |
# runs tuesday at 6:00 UTC | |
- cron: '0 6 * * 2' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
ReportTranslationStats: | |
permissions: | |
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo | |
pull-requests: write # for peter-evans/enable-pull-request-automerge | |
issues: write # for peter-evans/enable-pull-request-automerge | |
if: github.repository_owner == 'qgis' | |
runs-on: ubuntu-latest | |
env: | |
TRANSIFEX_PASSWORD: ${{ secrets.TRANSIFEX_PASSWORD }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BACKPORT_BRANCH: "release_3.28" | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- name: Check out repository | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: python3 -m pip install requests | |
- name: Report statistics | |
run: python3 ./scripts/load_tx_stats.py $TRANSIFEX_PASSWORD | |
- id: create_pr | |
name: Create Pull Request for master | |
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
push-to-fork: geo-ninja/QGIS-Documentation | |
commit-message: Update statistics of translation | |
title: Update statistics of translation | |
delete-branch: true | |
labels: | | |
Translation | |
backport ${{ env.BACKPORT_BRANCH }} | |
- name: Enable Pull Request Automerge | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }} | |
merge-method: rebase |