Skip to content

Commit

Permalink
Add label check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aadnekar committed Jan 22, 2024
1 parent 7ca6de7 commit 2526087
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check labels

on:
pull_request:
types:
- opened
- labeled
- unlabeled
branches:
- main

jobs:
check_labels:
runs-on: ubuntu-latest
steps:
- name: 'Required "doc required" or "doc not required" label'
if: >
contains(github.event.pull_request.labels.*.name, 'doc required') == false &&
contains(github.event.pull_request.labels.*.name, 'doc not required') == false
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Make sure to add the "doc required" or "doc not required" label. '
})
core.setFailed('Required "doc required" or "doc not required" label')

0 comments on commit 2526087

Please sign in to comment.