Commit 70dcc81
authored
fix: backtrack workflow leaves concrete branch rules behind after automated merges (#193)
The backtrack workflow locked concrete branches (e.g., `preview/1.0`,
`develop/1.0`) during automated merges but never properly cleaned them
up — the "restore" steps called the `lock` action with `lock-branch:
false`, which issues a `PUT` that modifies the rule but leaves the full
protection ruleset in place. Branches with no prior protection ended up
permanently protected after each run.
## Changes
- **`backtrack.yml`** — Replace all three "Restore protection" steps
with the `unlock` action (`DELETE /branches/{branch}/protection`)
instead of `lock` with `lock-branch: false` (`PUT
/branches/{branch}/protection`). Concrete per-branch rules are fully
removed after the merge; the manually-maintained glob pattern rules
(`develop/**`, `preview/**`, `release/**`) remain as the base
protection.
```yaml
# Before — PUT: flips lock_branch off but leaves the full ruleset behind
- uses: './.github/actions/github/branch-protection/lock'
with:
branch: ${{ steps.targets.outputs.develop-branch }}
token: ${{ secrets.GH_ADMIN_TOKEN }}
lock-branch: 'false'
# After — DELETE: removes the temporary concrete rule entirely
- uses: './.github/actions/github/branch-protection/unlock'
with:
branch: ${{ steps.targets.outputs.develop-branch }}
token: ${{ secrets.GH_ADMIN_TOKEN }}
fail-on-error: 'true'
```1 parent 29b9131 commit 70dcc81
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
0 commit comments