[IV-23/24] Objetivo 4 #533
Workflow file for this run
This file contains 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: Se han hecho las tareas previas al PR | |
on: | |
pull_request: | |
types: [opened,edited] | |
jobs: | |
get-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Comprobaciones sobre el cuerpo del PR | |
uses: actions/github-script@v5 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const checklist = /\s*[-\*]\s+\[\s*([xX]?)\s*\]\s+([A-Z]*):?/gm | |
const body = context.payload.pull_request.body | |
let match = checklist.exec(body) | |
let warned = false | |
while (match != null) { | |
let value = match[1] ? true : false | |
if ( value === false ) { | |
core.setFailed("⚠️ No has marcado " + match[2] + " ⚠") | |
if ( !warned ) { | |
core.warning("👉 Es importante que sigáis la lista de comprobación en cada entrega" ) | |
warned = true | |
} | |
} | |
match = checklist.exec(body) | |
} |