diff --git a/.github/pr_labels.yml b/.github/pr_labels.yml deleted file mode 100644 index d04f24f38..000000000 --- a/.github/pr_labels.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '1' -invalidStatus: "pending" -labelRule: - values: - - "validation" - - "no validation" diff --git a/.github/workflows/check_pr_label.yml b/.github/workflows/check_pr_label.yml new file mode 100644 index 000000000..cac9312cf --- /dev/null +++ b/.github/workflows/check_pr_label.yml @@ -0,0 +1,21 @@ +name: Check Label on PR +on: + pull_request: + types: [opened, synchronize, labeled, unlabeled] + +jobs: + check-pr_label: + runs-on: ubuntu-latest + steps: + - name: Checkout PR + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for all branches and tags + + - name: Check if the PR contains the label validation or no validation + id: prlabel_check + if: | + ! contains( github.event.pull_request.labels.*.name, 'validation') && ! contains( github.event.pull_request.labels.*.name, 'no validation') + run: | + echo "Neither 'validation' nor 'no validation' labels are present." + exit 1 # Exit with a failure \ No newline at end of file