feat(kody-rules): unlock plan-locked rules when an org moves to a paid plan #621
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: "Preview: Cleanup" | |
| # ============================================================================= | |
| # Updates PR comment when a PR is closed/merged. | |
| # - Railway: native PR environments auto-cleanup on PR close | |
| # - Vercel: auto-cleans (no action needed) | |
| # - This workflow only updates the PR comment | |
| # ============================================================================= | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| types: [ closed ] | |
| jobs: | |
| cleanup-comment: | |
| name: Update PR comment | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Mark preview as closed | |
| uses: actions/github-script@v9.0.0 | |
| with: | |
| script: | | |
| const marker = '## Preview Environment'; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.includes(marker)); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body: `## Preview Environment\n\n~~Preview environments have been cleaned up.~~`, | |
| }); | |
| } |