forked from qgis/QGIS-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.94 KB
/
translation_statistics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
strategy:
matrix:
target_branch: [release_3.28]
env:
TRANSIFEX_PASSWORD: ${{ secrets.TRANSIFEX_PASSWORD }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@03bee3930647ebbf994244c21ddbc0d4933aab4f # v2.3.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
ref: ${{ matrix.target_branch }}
- name: Set up Python 3.9
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.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@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # v4.2.4
with:
commit-message: Update statistics of translation
title: Update statistics of translation
delete-branch: true
labels: Translation
- name: Enable Pull Request Automerge
run: gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ GH_TOKEN }}