-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
34 lines (31 loc) · 1.15 KB
/
action.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
30
31
32
33
34
name: "Check our best practices"
description: "Check against our team's best practices for pull requests"
inputs:
token:
description: "A GitHub token to add a label to the PR"
required: true
regex:
description: "A custom regular expression for PR titles"
required: false
runs:
using: "composite"
steps:
- name: Install Python and depends
run: |
sudo apt install python3 python3-requests
shell: bash
- name: Run all PR best practice checks
env:
BODY: ${{ github.event.pull_request.body }}
TITLE: ${{ github.event.pull_request.title }}
TOKEN: ${{ inputs.token }}
REPOSITORY: ${{ github.event.repository.full_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
python3 "${{ github.action_path }}/pr_best_practices.py" --pr-description "$BODY"
set +e
python3 "${{ github.action_path }}/pr_best_practices.py" --pr-title "$TITLE"
if [ "$?" == 0 ]; then
python3 "${{ github.action_path }}/pr_best_practices.py" --add-label --token "$TOKEN" --repository "$REPOSITORY" --pr-number "$PR_NUMBER"
fi
shell: bash