diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml new file mode 100644 index 00000000000..8c78431bed2 --- /dev/null +++ b/.github/workflows/merge-to-main.yml @@ -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