From cbc3e6eda568a7adbea33db67a12c96d09ad6571 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 22 Apr 2026 12:38:04 +0200 Subject: [PATCH 1/2] Use `gh pr create` for update-schemas workflow --- .github/workflows/update-schemas.yml | 42 ++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update-schemas.yml b/.github/workflows/update-schemas.yml index ff109c8..9c1b9ad 100644 --- a/.github/workflows/update-schemas.yml +++ b/.github/workflows/update-schemas.yml @@ -31,14 +31,34 @@ jobs: curl -s https://develop.svn.wordpress.org/trunk/src/wp-includes/theme-i18n.json -o assets/theme-i18n.json curl -s https://develop.svn.wordpress.org/trunk/src/wp-includes/block-i18n.json -o assets/block-i18n.json - - name: Create pull request - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8 - with: - branch: update-schemas - base: ${{ github.event.repository.default_branch }} - token: ${{ secrets.GITHUB_TOKEN }} - title: Update schema fallback files - body: "**This is an automated pull-request**\n\nRefreshes the i18n schema files with the latest changes from core.\n\nThese are only used as a fallback if they can't be accessed directly." - reviewers: swissspidy - labels: scope:distribution - commit-message: "Update schema fallback files" + - name: Commit and Create Pull Request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ -n "$(git status --porcelain)" ]; then + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b update-schemas + git add assets/ + git commit -m "Update schema fallback files" + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git + git push -f origin update-schemas + + PR_NUMBER=$(gh pr list --head update-schemas --json number --jq '.[0].number') + if [ -z "$PR_NUMBER" ]; then + gh pr create \ + --title "Update schema fallback files" \ + --body-file - < Date: Wed, 22 Apr 2026 17:32:56 +0200 Subject: [PATCH 2/2] Fix multiline body --- .github/workflows/update-schemas.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-schemas.yml b/.github/workflows/update-schemas.yml index 9c1b9ad..e8fa94d 100644 --- a/.github/workflows/update-schemas.yml +++ b/.github/workflows/update-schemas.yml @@ -34,6 +34,12 @@ jobs: - name: Commit and Create Pull Request env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_BODY: | + **This is an automated pull-request** + + Refreshes the i18n schema files with the latest changes from core. + + These are only used as a fallback if they can't be accessed directly. run: | if [ -n "$(git status --porcelain)" ]; then git config user.name "github-actions[bot]" @@ -48,13 +54,7 @@ jobs: if [ -z "$PR_NUMBER" ]; then gh pr create \ --title "Update schema fallback files" \ - --body-file - <