From 81c1f02aa48e8e9f94903256d113036268846690 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 9 Jun 2026 14:15:55 +0200 Subject: [PATCH 1/3] Add workflow to regenerate the workflow manifest Useful if forgotten in a PR --- .github/workflows/regenerate-manifest.yml | 78 +++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/regenerate-manifest.yml diff --git a/.github/workflows/regenerate-manifest.yml b/.github/workflows/regenerate-manifest.yml new file mode 100644 index 00000000..3c90f49b --- /dev/null +++ b/.github/workflows/regenerate-manifest.yml @@ -0,0 +1,78 @@ +name: Regenerate Manifest + +on: + workflow_dispatch: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + pull-requests: write + +jobs: + regenerate-manifest: + name: Regenerate manifest + runs-on: ubuntu-latest + steps: + - name: Check out source code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Set up PHP environment + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2 + with: + php-version: 'latest' + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Composer dependencies & cache dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4 + + - name: Install WP-CLI + run: | + curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar + sudo mv wp-cli-nightly.phar /usr/local/bin/wp + sudo chmod +x /usr/local/bin/wp + + - name: Generate handbook manifest + run: wp handbook gen-hb-manifest + env: + WP_CLI_CONFIG_PATH: /dev/null + + - name: Commit and Create Pull Request + env: + GH_TOKEN: ${{ github.token }} + PR_BODY: | + **This is an automated pull-request** + + Updates the `handbook-manifest.json` file with the latest changes. + 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-handbook-manifest + git add bin/handbook-manifest.json + git commit -m "Regenerate handbook manifest" + git push -f origin update-handbook-manifest + + PR_NUMBER=$(gh pr list --head update-handbook-manifest --json number --jq '.[0].number // empty') + if [ -z "$PR_NUMBER" ]; then + gh pr create \ + --title "Update handbook manifest" \ + --body "$PR_BODY" \ + --label "scope:distribution" \ + --base "${{ github.event.repository.default_branch }}" \ + --head "update-handbook-manifest" \ + --reviewer "swissspidy" + else + gh pr edit "$PR_NUMBER" \ + --title "Update handbook manifest" \ + --body "$PR_BODY" \ + --add-label "scope:distribution" \ + --base "${{ github.event.repository.default_branch }}" + fi + fi From acaacdcf3dafe8a5a5727741424f6896cbd85b2a Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 9 Jun 2026 14:24:06 +0200 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/regenerate-manifest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regenerate-manifest.yml b/.github/workflows/regenerate-manifest.yml index 3c90f49b..d218109e 100644 --- a/.github/workflows/regenerate-manifest.yml +++ b/.github/workflows/regenerate-manifest.yml @@ -49,7 +49,7 @@ jobs: PR_BODY: | **This is an automated pull-request** - Updates the `handbook-manifest.json` file with the latest changes. + Updates the `bin/handbook-manifest.json` file with the latest changes. run: | if [ -n "$(git status --porcelain)" ]; then git config user.name "github-actions[bot]" From 0c1d849312f9308d771b51e99264a88afe68f7f0 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 9 Jun 2026 14:24:13 +0200 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/regenerate-manifest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regenerate-manifest.yml b/.github/workflows/regenerate-manifest.yml index d218109e..513415c4 100644 --- a/.github/workflows/regenerate-manifest.yml +++ b/.github/workflows/regenerate-manifest.yml @@ -57,7 +57,7 @@ jobs: git checkout -b update-handbook-manifest git add bin/handbook-manifest.json git commit -m "Regenerate handbook manifest" - git push -f origin update-handbook-manifest + git push --force-with-lease origin update-handbook-manifest PR_NUMBER=$(gh pr list --head update-handbook-manifest --json number --jq '.[0].number // empty') if [ -z "$PR_NUMBER" ]; then