Skip to content

docs(templates): ajuste pr templates #35

docs(templates): ajuste pr templates

docs(templates): ajuste pr templates #35

Workflow file for this run

name: PR has a valid Issue?
on:
pull_request_target:
types: [ edited, synchronize, opened, reopened ]
jobs:
checker:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout code from PR (Safe Checkout)
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Validate PR
uses: thehanimo/pr-title-checker@v1.4.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
remote_configuration_path: "https://raw.githubusercontent.com/leoviana00/lab-k8s-prep-cks/main/.github/pr-title-checker-config.json"
# - 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 }}
- 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"
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"