From 2f12c3485bfb5c6d7a88be93cbd842a4ac15cf01 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 27 Dec 2025 08:16:49 +0000 Subject: [PATCH 1/2] Fix README setup instructions to match actual workflow - Simplified workflow setup to match actual .github/workflows/update-pr-stack.yml - Added critical requirement to disable auto-delete head branches - Included both UI and CLI methods for disabling auto-delete (following e2e test pattern) - Removed unnecessary permissions (repository-projects: read) - Removed redundant checkout steps and job conditionals --- README.md | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index ed5d923..230848a 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,24 @@ After you manually resolve the conflict and push: ### Setup +**1. Disable auto-delete head branches** + +The action manages branch deletion itself. GitHub's auto-delete setting must be disabled: + +**Via Settings (recommended):** +- Go to your repository Settings → General → Pull Requests +- Uncheck "Automatically delete head branches" + +**Via GitHub CLI:** +```bash +gh api -X PATCH "/repos/OWNER/REPO" --input - <<< '{"delete_branch_on_merge":false}' +``` + +**2. Add the workflow** + Create a `.github/workflows/update-pr-stack.yml` file: ```yaml -name: Update Stacked PRs on Squash Merge +name: Update PR Stack on: pull_request: @@ -55,38 +70,14 @@ on: permissions: contents: write pull-requests: write - repository-projects: read jobs: update-pr-stack: - if: github.event.action == 'closed' && github.event.pull_request.merged == true && github.event.pull_request.merge_commit_sha != '' runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Update PR stack - uses: Phlogistique/autorestack-action@main - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - continue-after-conflict-resolution: - if: github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'autorestack-needs-conflict-resolution') - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Continue PR stack update - uses: Phlogistique/autorestack-action@main + - uses: Phlogistique/autorestack-action@main with: github-token: ${{ secrets.GITHUB_TOKEN }} - mode: conflict-resolved - pr-branch: ${{ github.event.pull_request.head.ref }} ``` ### Notes From 23f0dafc949e70f0127ecf8862d1908f7256a1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Rubinstein?= Date: Sat, 27 Dec 2025 09:20:27 +0100 Subject: [PATCH 2/2] Apply suggestion from @Phlogistique --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 230848a..9e91fc4 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ After you manually resolve the conflict and push: The action manages branch deletion itself. GitHub's auto-delete setting must be disabled: -**Via Settings (recommended):** +**Via Settings:** - Go to your repository Settings → General → Pull Requests - Uncheck "Automatically delete head branches"