From 76acd0d5c15982b11175091568383f088a72c7cf Mon Sep 17 00:00:00 2001 From: josefaidt Date: Mon, 25 Sep 2023 12:09:28 -0700 Subject: [PATCH] adds GitHub Action to verify PRs to main have a valid semver label --- .github/workflows/pr-has-semver-label.yml | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pr-has-semver-label.yml diff --git a/.github/workflows/pr-has-semver-label.yml b/.github/workflows/pr-has-semver-label.yml new file mode 100644 index 00000000..5d8a7fc7 --- /dev/null +++ b/.github/workflows/pr-has-semver-label.yml @@ -0,0 +1,27 @@ +name: pr-has-semver-label +on: + pull_request_target: + branches: + - main + types: + - opened + - labeled + - unlabeled + - ready_for_review +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + pr-has-semver-label: + if: github.event.pull_request.draft == false + name: pr-has-semver-label + runs-on: ubuntu-latest + steps: + - id: check + if: | + contains(github.event.pull_request.labels.*.name, 'semver: major') || + contains(github.event.pull_request.labels.*.name, 'semver: minor') || + contains(github.event.pull_request.labels.*.name, 'semver: patch') + run: exit 0 + - if: ${{ steps.check.conclusion == 'skipped' }} + run: exit 1