diff --git a/.github/new-pr-comment.md b/.github/new-pr-comment.md new file mode 100644 index 00000000..a9f6b0b8 --- /dev/null +++ b/.github/new-pr-comment.md @@ -0,0 +1,11 @@ +### 👋 Thanks for opening a pull request! + +If you are new, please check out the trimmed down summary of our deployment process below: + +1. 👀 Observe the CI jobs and tests to ensure they are passing +1. ✔️ Obtain an approval/review on this pull request +1. 🚀 Branch deploy your pull request to production + + > Comment `.deploy` on this pull request to trigger a deploy. If anything goes wrong, rollback with `.deploy main` + +1. 🎉 Merge! diff --git a/.github/workflows/new-pr.yml b/.github/workflows/new-pr.yml index b55d0844..2fab0bff 100644 --- a/.github/workflows/new-pr.yml +++ b/.github/workflows/new-pr.yml @@ -6,37 +6,18 @@ on: - main permissions: - issues: write pull-requests: write + issues: write jobs: - plan: + comment: + if: github.event_name == 'pull_request' && github.event.action == 'opened' runs-on: ubuntu-latest steps: - # Post a comment on newly opened PRs describing the deployment process and related PR steps to deploy - - name: new pull request - if: github.event_name == 'pull_request' && github.event.action == 'opened' - uses: actions/github-script@f05a81df23035049204b043b50c3322045ce7eb3 # pin@v3 + # Comment on new PR requests with deployment instructions + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3.0.2 + - name: comment + uses: GrantBirki/comment@bb830751dec236a7779e86b2fa1566448f9e7c5f # pin@v1.0.0 with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const commentBody = `\ - ### 👋 Thanks for opening a pull request! - - If you are new, please check out the trimmed down summary of our deployment process below: - - 1. 👀 Observe the CI jobs and tests to ensure they are passing - 1. ✔️ Obtain an approval/review on this pull request - 1. 🚀 Branch deploy your pull request to production - - > Comment \`.deploy\` on this pull request to trigger a deploy. If anything goes wrong, rollback with \`.deploy main\` - - 1. 🎉 Merge! - ` - - await github.issues.createComment({ - ...context.repo, - issue_number: context.issue.number, - body: commentBody - }) + file: .github/new-pr-comment.md