| 1 |
name: Notify Translations |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request_target: # zizmor: ignore[dangerous-triggers] |
| 5 |
types: |
| 6 |
- labeled |
| 7 |
- closed |
| 8 |
branches: |
| 9 |
- master |
| 10 |
workflow_dispatch: |
| 11 |
inputs: |
| 12 |
number: |
| 13 |
description: PR number |
| 14 |
required: true |
| 15 |
debug_enabled: |
| 16 |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' |
| 17 |
required: false |
| 18 |
default: 'false' |
| 19 |
|
| 20 |
permissions: {} |
| 21 |
|
| 22 |
jobs: |
| 23 |
job: |
| 24 |
runs-on: ubuntu-latest |
| 25 |
permissions: |
| 26 |
discussions: write |
| 27 |
timeout-minutes: 5 |
| 28 |
steps: |
| 29 |
- name: Dump GitHub context |
| 30 |
env: |
| 31 |
GITHUB_CONTEXT: ${{ toJson(github) }} |
| 32 |
run: echo "$GITHUB_CONTEXT" |
| 33 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 34 |
with: |
| 35 |
ref: ${{ github.event.repository.default_branch }} |
| 36 |
persist-credentials: false |
| 37 |
- name: Set up Python |
| 38 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 |
| 39 |
with: |
| 40 |
python-version-file: ".python-version" |
| 41 |
- name: Setup uv |
| 42 |
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 |
| 43 |
with: |
| 44 |
# Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. |
| 45 |
# See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 |
| 46 |
version: "0.11.18" |
| 47 |
enable-cache: true |
| 48 |
cache-dependency-glob: | |
| 49 |
pyproject.toml |
| 50 |
uv.lock |
| 51 |
- name: Install Dependencies |
| 52 |
run: uv sync --locked --no-dev --group github-actions |
| 53 |
# Allow debugging with tmate |
| 54 |
- name: Setup tmate session |
| 55 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 # v3.24 |
| 56 |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }} |
| 57 |
with: |
| 58 |
limit-access-to-actor: true |
| 59 |
env: |
| 60 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 |
- name: Notify Translations |
| 62 |
run: uv run ./scripts/notify_translations.py |
| 63 |
env: |
| 64 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 65 |
NUMBER: ${{ github.event.inputs.number || null }} |
| 66 |
DEBUG: ${{ github.event.inputs.debug_enabled || 'false' }} |