Skip to content

Commit

Permalink
Add action to show a message when merging to the main branch (#4301)
Browse files Browse the repository at this point in the history
* Add action to show a message when merging to the main branch

* Fail if label 'merge-main-ack' is not present
  • Loading branch information
rlazo authored Nov 10, 2022
1 parent 6e5c1b8 commit 0ba9bc3
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/merge-to-main.yml
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

0 comments on commit 0ba9bc3

Please sign in to comment.