Refactor/gilded rose strategy #228
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "PR Tasks Completed Check" | |
| on: | |
| pull_request: | |
| types: opened | |
| jobs: | |
| task-check: | |
| # github.event.repository.name only contains 'GildedRose-Refactoring-Kata' (no owner)! | |
| # we could check owner and name if: github.repository == 'emilybache/GildedRose-Refactoring-Kata' | |
| # but checking owner is enough/better/more stable | |
| # Only run from the base repository | |
| if: github.repository_owner == 'emilybache' | |
| 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 Pull Request containing a Kata solution to the original repo from Emily Bache. If you are instead trying to add an improvement, 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' | |
| }) |