Skip to content

Commit

Permalink
Merge pull request #40 from the-hideout/comment-action
Browse files Browse the repository at this point in the history
Use Comment Action
  • Loading branch information
GrantBirki authored May 24, 2022
2 parents 9df9d48 + 51e897a commit 31dbe4c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
11 changes: 11 additions & 0 deletions .github/new-pr-comment.md
Original file line number Diff line number Diff line change
@@ -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!
35 changes: 8 additions & 27 deletions .github/workflows/new-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 # [email protected]
- 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

0 comments on commit 31dbe4c

Please sign in to comment.