Add PR validation workflow

This commit is contained in:
Michael Frikke Depner 2023-08-28 12:55:24 +02:00
parent 92d55951aa
commit edc48ebf3b
No known key found for this signature in database
GPG Key ID: 22476799D26CEB62

26
.github/workflows/pr-validation.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: "PR Tasks Completed Check"
on:
pull_request:
types: opened
jobs:
task-check:
runs-on: ubuntu-latest
steps:
- name: Close PR if checkmark is missing
if: ${{ !contains(github.event.pull_request.body, '[X] I acknowledge') }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Please don't submit a PR containing Kata solutions. If you are adding an improvement to the Katas repo, please resubmit this PR and check the `[X]` box in the PR template.'
})
github.rest.pulls.update({
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
})