Skip to content

Translation statistics #190

Translation statistics

Translation statistics #190

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@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Check out repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
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:
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 }}