Translation statistics #34
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 }} | |
LABELS: "Translation, backport release_3.34" | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- name: Check out repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
with: | |
python-version: '3.11' | |
- 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@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 | |
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: ${{ env.LABELS }} |