-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
36 lines (32 loc) · 1.01 KB
/
action.yaml
File metadata and controls
36 lines (32 loc) · 1.01 KB
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
30
31
32
33
34
35
36
name: Check pull request description checkbox
description: 'Validate if a specific checkbox in a pull request description is checked or not.'
branding:
icon: 'award'
color: 'green'
on:
pull_request:
types: [opened, synchronize, edited]
# Here you must declare the name of the checkbox you want to verify
# remember the name of your checkbox must be in lowercase
env:
checkbox: "integration test (mandatory)"
jobs:
check_pull_request:
runs-on: ubuntu-latest
steps:
- name: Check pull request description
env:
BODY: ${{ github.event.pull_request.body }}
run: |
UNCHECKED="\[ \] $checkbox"
MARKED="\[x\] $checkbox"
if echo ${BODY,,} | grep -q "$MARKED"; then
echo "Checkbox is checked"
exit 0
elif echo ${BODY,,} | grep -q "$UNCHECKED"; then
echo "Checkbox is not checked"
exit 1
else
echo "Checkbox not found in pull request description"
exit 1
fi