Fixed cicd tear down condition to destroy a staging environment#545
Fixed cicd tear down condition to destroy a staging environment#545
Conversation
ref https://linear.app/ghost/issue/AP-976 - Added closed to the pr check to tear down the staging environment.
WalkthroughThe workflow file responsible for tearing down ephemeral staging environments was updated to broaden the criteria for environment deletion. Previously, the workflow only targeted pull requests that had been merged. With this change, the workflow will now also target pull requests that have been closed, regardless of whether they were merged. This adjustment ensures that environments associated with both merged and closed pull requests are marked for deletion. No other aspects of the workflow logic were modified. Possibly related PRs
Suggested labels
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/ephemeral-staging-teardown.yml (1)
39-39: Confirm GH CLIstatevalues and simplify conditionThe
gh pr view --json statefield maps merged PRs toCLOSED(GraphQL only hasOPENorCLOSED), so the"MERGED"branch will never fire. You can simplify this to:if [ "$PR_STATE" = "CLOSED" ]; then … fiIf you truly need to distinguish merged vs. unmerged closures, fetch the boolean with:
gh pr view $PR_NUMBER --json state,merged | jq -r '.merged'and test
.merged.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ephemeral-staging-teardown.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build, Test and Push
ref https://linear.app/ghost/issue/AP-976