Skip to content

Version Packages

Version Packages #1541

name: Release Checklist
on:
push:
branches:
- 'changeset-release/*'
jobs:
release-checklist:
# Only run on Release Tracking branch
if: ${{ github.repository == 'primer/view_components' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Get or Create Comment
if: success() && steps.findPr.outputs.number
uses: actions/github-script@v7
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)
})
}