Skip to content

Add action to show a message when merging to the main branch #4301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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