Skip to content

Commit 9187428

Browse files
fix(ci): keep a failed unlabeled teardown visible to the scheduled retry
An unlabeled event removes relay:preview before the teardown runs, so a failed destroy left a stage no retry could find. The job now restores the label after a failed destroy. Labels added with GITHUB_TOKEN do not start new runs, so the deploy workflow does not fire. Co-Authored-By: Claude Haiku 5.5 <[email protected]>
1 parent 4a02715 commit 9187428

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎.github/workflows/relay-preview-cleanup.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ jobs:
9191
if: github.event.action == 'closed'
9292
run: gh pr edit "${{ github.event.pull_request.number }}" --repo "$GITHUB_REPOSITORY" --remove-label relay:preview
9393

94+
# An unlabeled event has already removed the label, so a failed teardown
95+
# must put it back or no retry will ever see the stage. Labels added with
96+
# GITHUB_TOKEN do not start new runs, so this does not redeploy.
97+
- name: Restore the teardown marker after a failed destroy
98+
if: failure() && github.event.action == 'unlabeled'
99+
run: gh pr edit "${{ github.event.pull_request.number }}" --repo "$GITHUB_REPOSITORY" --add-label relay:preview
100+
94101
list_closed_previews:
95102
name: List closed relay previews
96103
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request_target'

0 commit comments

Comments
 (0)