-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action to show a message when merging to the main branch (#4301)
* Add action to show a message when merging to the main branch * Fail if label 'merge-main-ack' is not present
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 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,40 @@ | ||
name: Merge to main | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- labeled | ||
- unlabeled | ||
|
||
jobs: | ||
pr-message: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: > | ||
### 📝 PRs merging into main branch | ||
**Our main branch should always be in a releasable state**. | ||
If you are working on a larger change, or if you don't want | ||
this change to see the light of the day just yet, consider | ||
using a feature branch first, and only merge into the main | ||
branch when the code complete and ready to be released. | ||
**Add the 'main-merge-ack' label to your PR to confirm | ||
merging into the main branch is intended.** | ||
- name: Label checker | ||
if: "!contains( github.event.pull_request.labels.*.name, 'main-merge-ack')" | ||
run: | | ||
echo Missing 'main-merge-ack' label. Read the comment about merging to master in your PR for more information. | ||
exit 1 | ||
- name: Success | ||
run: exit 0 |