diff --git a/.github/workflows/main-label-check.yml b/.github/workflows/main-label-check.yml new file mode 100644 index 00000000..3d3c02c5 --- /dev/null +++ b/.github/workflows/main-label-check.yml @@ -0,0 +1,17 @@ +name: main_label_check + +on: + pull_request: + types: [opened, edited, labeled, unlabeled] + +jobs: + label_check: + runs-on: ubuntu-latest + steps: + - name: Fail if no "production release" label is present while targeting main + if: ${{github.event.pull_request.base.ref == 'main' && !contains(github.event.pull_request.labels.*.name, 'production release')}} + uses: actions/github-script@v3 + with: + script: | + core.setFailed("Label is missing: add a 'production release' label in order to merge to main") +