generated from JJ/plantilla-IV
-
Notifications
You must be signed in to change notification settings - Fork 31
29 lines (28 loc) · 1016 Bytes
/
get-pr-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)
}