Skip to content

Commit

Permalink
[enhancement] Add a label checker to GitHub Actions (#2885)
Browse files Browse the repository at this point in the history
* Create label_enforcement.yml

* Update label_enforcement.yml

* Update and rename label_enforcement.yml to label-enforcement.yml

* Update label-enforcement.yml

* Update label-enforcement.yml
  • Loading branch information
icfaust authored Aug 30, 2024
1 parent ffed86d commit 758f4cc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/label-enforcement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Enforce Labels
on:
pull_request:
branches: [ "main" ]

jobs:
label_checker:
name: Please include labels on your pull request
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: test
run: |
LABELS=`gh api -H "Accept: application/vnd.github+json" /repos/oneapi-src/oneDAL/issues/${{ github.event.pull_request.number }}/labels | jq '[.[].name]'`
echo $LABELS
if [[ $LABELS == "[]" ]] || [[ $LABELS == "[\"RFC\"]" ]]; then
echo "::error::No label set on the pull request"
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 758f4cc

Please sign in to comment.