[codex] Allow leg splitting in edit modes #219
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cleanup PR Deployments | |
| # Marks every `pr-preview-<NUM>` deployment for a closed PR as inactive so the | |
| # GitHub Deployments tab doesn't accumulate stale `success` entries from | |
| # merged or abandoned previews. The deployment URLs themselves still resolve | |
| # (Pages keeps the static files under /pr/<NUM>/), but the View deployment | |
| # button on closed PRs no longer suggests they are live. | |
| on: | |
| pull_request: | |
| types: [closed] | |
| permissions: | |
| contents: read | |
| deployments: write | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Mark PR deployments inactive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| ENV_NAME: pr-preview-${{ github.event.number }} | |
| run: | | |
| set -e | |
| IDS=$(gh api "repos/${{ github.repository }}/deployments?environment=${ENV_NAME}" --jq '.[].id') | |
| if [ -z "$IDS" ]; then | |
| echo "No deployments found for environment ${ENV_NAME} — nothing to clean up." | |
| exit 0 | |
| fi | |
| for ID in $IDS; do | |
| echo "Marking deployment $ID inactive (env=${ENV_NAME})" | |
| gh api "repos/${{ github.repository }}/deployments/$ID/statuses" \ | |
| --input - <<EOF | |
| { | |
| "state": "inactive", | |
| "description": "PR closed" | |
| } | |
| EOF | |
| done |