Version Packages #316
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: Release Checklist | |
| on: | |
| push: | |
| branches: | |
| - 'changeset-release/*' | |
| permissions: {} | |
| jobs: | |
| release-checklist: | |
| # Only run on Release Tracking branch | |
| if: ${{ github.repository == 'opf/primer_view_components' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: jwalton/gh-find-current-pr@f3d61b485d2801773f7a07b2aaa3306bd8f8e653 # v1 | |
| id: findPr | |
| - name: Get or Create Comment | |
| if: success() && steps.findPr.outputs.number | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| env: | |
| PR_NUMBER: ${{ steps.findPr.outputs.pr }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs') | |
| const body = await fs.readFileSync('.github/release_template.md', 'utf8') | |
| const result = await github.rest.issues.listComments({ | |
| issue_number: `${process.env.PR_NUMBER}`, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo | |
| }); | |
| const botComments = result.data.filter(c => c.user.login == 'github-actions[bot]') | |
| if (!botComments.length) { | |
| await github.rest.issues.createComment({ | |
| issue_number: `${process.env.PR_NUMBER}`, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body.replace('{{PR_AUTHOR}}', context.payload.sender.login) | |
| }) | |
| } |