mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
Add PR validation workflow
This commit is contained in:
parent
92d55951aa
commit
dd201077dd
34
.github/workflows/pr-validation.yml
vendored
Normal file
34
.github/workflows/pr-validation.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
name: "PR Tasks Completed Check"
|
||||
on:
|
||||
pull_request:
|
||||
types: opened
|
||||
|
||||
jobs:
|
||||
task-check:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Comment 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."
|
||||
})
|
||||
- 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.pulls.update({
|
||||
pull_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user