Skip to content

Translation statistics #184

Translation statistics

Translation statistics #184

name: Translation statistics
# Pull statistics of translation in Transifex
on:
schedule:
# runs tuesday at 6:00 UTC
- cron: '0 6 * * 2'
workflow_dispatch:
permissions: # added using https://github.com/step-security/secure-repo
contents: read
jobs:
ReportTranslationStats:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
pull-requests: write # for peter-evans/create-pull-request to create a PR
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@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Check out repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 1
- name: Set up Python 3.9
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
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@284f54f989303d2699d373481a0cfa13ad5a6666 # v5.0.1
with:
commit-message: Update statistics of translation
title: Update statistics of translation
delete-branch: true
labels: |
Translation
backport ${{ env.BACKPORT_BRANCH }}
# Temporarily disable automerge to check why tests do not start
# - name: Enable Pull Request Automerge
# run: gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}"
# env:
# GH_TOKEN: ${{ env.GH_TOKEN }}