refactor: Use theme blocks for PDP #6
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
| # A check that runs on release-please PRs that checks if an PRs with | |
| # `autorelease:blocking` are open. If so, the check fails and prevents | |
| # a new release from being published. | |
| # | |
| # Outcomes: | |
| # - Makes sure that we handle + previews changes in from production before | |
| # proceeding with a new release | |
| name: Check Blocking PRs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| check-blocking-prs: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event.pull_request.head.ref == 'release-please--branches--main' && | |
| startsWith(github.event.pull_request.title, 'chore(main): release') | |
| steps: | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| uses: tibdex/github-app-token@v1 | |
| with: | |
| app_id: ${{ secrets.ARCHETYPE_GITHUB_APP_ID }} | |
| private_key: ${{ secrets.ARCHETYPE_GITHUB_APP_KEY }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - name: Verify Release-Please PR | |
| id: verify | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const labels = context.payload.pull_request.labels.map(label => label.name); | |
| if (!labels.includes('autorelease: pending')) { | |
| return { skip: 'true' }; | |
| } | |
| return { skip: 'false' }; | |
| - name: Set skip environment variable | |
| run: echo "skip=${{ steps.verify.outputs.skip }}" >> $GITHUB_ENV | |
| - name: Check for blocking PRs | |
| if: env.skip != 'true' | |
| run: | | |
| echo "Checking for open PRs with the label 'autorelease:blocking'..." | |
| PRS=$(gh pr list --label 'autorelease:blocking' --json number,title) | |
| if [[ "$PRS" != "[]" ]]; then | |
| echo "Found blocking PRs:" | |
| echo "$PRS" | |
| exit 1 | |
| else | |
| echo "No blocking PRs found." | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |