-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from the-hideout/comment-action
Use Comment Action
- Loading branch information
Showing
2 changed files
with
19 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
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! |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |