Skip to content

fix(setup-ci): GitLab delete-merged-branch tolerates an already deleted branch - #126

Merged
HosseinNejatiJavaremi merged 1 commit into
mainfrom
fix/gitlab-delete-branch-gone
Oct 28, 2026
Merged

HosseinNejatiJavaremi merged 1 commit into
mainfrom
fix/gitlab-delete-branch-gone

Conversation

@HosseinNejatiJavaremi

Copy link
Copy Markdown
Member

The protected-branch lookup added in #117 returns 404 when the source branch was already deleted on merge (the open-pr/merge-pr flow). curl -f exits 22, which fails the job under pipefail. The lookup now falls back to gone and the job exits 0 unless the branch exists and is unprotected.

GitHub workflow checked, no change: the lookup runs inside an if [ "$(...)" = true ] test, so a failed lookup is tolerated and the DELETE already ends in || echo.

Tested: stubbed curl under bash -eo pipefail for gone, protected and unprotected (DELETE only runs for unprotected); YAML parses; pytest (92 passed). Not run on a live runner.

Closes #125

…ed branch

The protected-branch lookup returned 404 for a branch deleted on merge,
and curl -f failed the job under pipefail. A missing branch now means
nothing to delete.
@HosseinNejatiJavaremi HosseinNejatiJavaremi added bug Something is broken priority:high Needs attention soon area:ci CI, workflows, release tooling labels Oct 28, 2026
@HosseinNejatiJavaremi HosseinNejatiJavaremi self-assigned this Oct 28, 2026
@HosseinNejatiJavaremi
HosseinNejatiJavaremi merged commit f023b8d into main Oct 28, 2026
3 checks passed
@HosseinNejatiJavaremi
HosseinNejatiJavaremi deleted the fix/gitlab-delete-branch-gone branch October 28, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, workflows, release tooling bug Something is broken priority:high Needs attention soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(setup-ci): GitLab delete-merged-branch fails when the source branch is already deleted

1 participant