Skip to content

Commit aa4b9ee

Browse files
Slashgearclaude
andcommitted
fix(ci): delete GitHub environment on PR cleanup
The cleanup workflow deleted the Scaleway container and Docker image but left the GitHub environment behind, causing stale entries to accumulate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c8a85cf commit aa4b9ee

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/deploy-cleanup.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: 🧹 Cleanup
22
permissions:
33
contents: read
4+
deployments: write
45
on:
56
pull_request:
67
types: [closed]
@@ -56,6 +57,16 @@ jobs:
5657
echo "No image found with tag ${IMAGE_TAG}, skipping"
5758
fi
5859
60+
- name: Delete GitHub environment
61+
env:
62+
GH_TOKEN: ${{ github.token }}
63+
run: |
64+
PR_NUMBER="${{ github.event.pull_request.number }}"
65+
ENV_NAME="preview-pr-${PR_NUMBER}"
66+
67+
echo "Deleting GitHub environment ${ENV_NAME}"
68+
gh api --method DELETE "repos/${{ github.repository }}/environments/${ENV_NAME}" || echo "Environment ${ENV_NAME} not found, skipping"
69+
5970
registry-cleanup:
6071
name: 🧹 Purge old production images
6172
if: github.event_name == 'schedule'

0 commit comments

Comments
 (0)