forked from GreenBlitz/GB-Robot-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.24 KB
/
Copy pathcheckLabels.yml
File metadata and controls
63 lines (63 loc) · 2.24 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#name: Check Labels
#
#on:
# pull_request:
# types:
# - opened
# - labeled
# - unlabeled
# - synchronize
#
#
#jobs:
# check-labels:
# runs-on: ubuntu-latest
# env:
# PASSED_ALL_TESTS: "passed-all-tests"
# NO_NEED_ROBOT: "no-need-of-robot-testing"
# NO_NEED_SIMULATION: "no-need-of-simulation-testing"
# steps:
# - name: Get PR Labels
# id: pr-info
# run: |
# LABELS=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${{ github.event.pull_request.number }}/labels" | jq -r '.[].name' | tr '\n' ' ')
# echo "Labels for PR: ${LABELS}"
# echo "existing_labels=${LABELS}" >> $GITHUB_ENV
#
# - name: Check On Push if no need appear
# if: ${{ github.event.action == 'synchronize' }}
# run: |
# EXISTING_LABELS="${{env.existing_labels}}"
#
# if [[ "${EXISTING_LABELS}" =~ "${NO_NEED_ROBOT}" && "${EXISTING_LABELS}" =~ "${NO_NEED_SIMULATION}" ]]; then
# echo "Label '${NO_NEED_ROBOT}' and label '${NO_NEED_SIMULATION}' found."
# exit 0
# fi
#
# echo "This is a push event and no no-need-testing was found"
# exit 1
#
# - name: Check Absent Labels
# run: |
# EXISTING_LABELS="${{env.existing_labels}}"
# declare -a absent_labels=("waiting-for-another-pr" "needs-robot-testing" "needs-simulation-testing")
# for label in "${absent_labels[@]}"; do
# if [[ "${EXISTING_LABELS}" =~ "${label}" ]]; then
# echo "Label '${label}' should not be present."
# exit 1
# fi
# done
#
# - name: Check Present Label
# run: |
# EXISTING_LABELS="${{env.existing_labels}}"
# if [[ "${EXISTING_LABELS}" =~ "${PASSED_ALL_TESTS}" ]]; then
# echo "Label '${PASSED_ALL_TESTS}' found."
# exit 0
# fi
# if [[ "${EXISTING_LABELS}" =~ "${NO_NEED_ROBOT}" && "${EXISTING_LABELS}" =~ "${NO_NEED_SIMULATION}" ]]; then
# echo "Label "${NO_NEED_ROBOT}" and label "${NO_NEED_SIMULATION}" found."
# exit 0
# fi
# echo "no passed-all-tests Or no-need-of-robot-testing And no-need-of-simulation-testing was found."
# exit 1