From 9eb40abbae1718f8288df66ceb7ba71d54ce99c3 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 21 Apr 2026 14:00:25 +0200 Subject: [PATCH] Use a gh app for making the PR to update l10n data It should help to avoid having the subsequent workflows being stuck. --- .github/workflows/update_locales.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_locales.yml b/.github/workflows/update_locales.yml index 5b50d3b83..fdf18287f 100644 --- a/.github/workflows/update_locales.yml +++ b/.github/workflows/update_locales.yml @@ -6,19 +6,27 @@ on: workflow_dispatch: # Allow manual triggering permissions: - contents: write - pull-requests: write + contents: read jobs: update-locales: name: Update locales runs-on: ubuntu-latest + environment: sync_l10n steps: + - name: Generate app token + id: app-token + uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 + with: + client-id: ${{ secrets.CLIENT_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: - persist-credentials: true + token: ${{ steps.app-token.outputs.token }} + persist-credentials: false - name: Use Node.js LTS uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 @@ -34,7 +42,7 @@ jobs: - name: Create Pull Request env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} run: | if [ -z "$(git status --porcelain l10n/)" ]; then echo "No locale changes to commit." @@ -42,6 +50,7 @@ jobs: fi git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}" git switch -C update-locales git add l10n/ git commit -m "l10n: Update locale files"