python-scripts/.github/workflows/checker.yml

39 lines
1.3 KiB
YAML
Raw Normal View History

2022-10-04 14:55:10 +00:00
name: PR has a valid Issue?
2022-10-04 14:53:44 +00:00
on:
pull_request_target:
types: [ edited, synchronize, opened, reopened ]
jobs:
checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Issue Validator
uses: HarshCasper/validate-issues-over-pull-requests@v0.1.1
id: validator
with:
prbody: ${{ github.event.pull_request.body }}
prurl: ${{ github.event.pull_request.url }}
2022-10-04 14:55:10 +00:00
- name: PR has a valid Issue
if: ${{ steps.validator.outputs.valid == 1 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
run: |
gh pr edit $PRNUM --add-label "PR:Ready-to-Review"
2022-10-04 22:44:10 +00:00
gh pr edit $PRNUM --add-label "hacktoberfest-accepted"
2022-10-04 14:55:10 +00:00
gh pr edit $PRNUM --remove-label "PR:No-Issue"
- name: PR has no valid Issue
if: ${{ steps.validator.outputs.valid == 0 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRNUM: ${{ github.event.pull_request.number }}
run: |
gh pr comment $PRNUM --body "PR is not linked to any issue, please make the corresponding changes in the body."
gh pr edit $PRNUM --add-label "PR:No-Issue"