forked from operator-framework/community-operators
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (54 loc) · 2.39 KB
/
reviewer.yaml
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
name: Handle review
on:
pull_request_review:
types: [submitted, edited]
jobs:
test:
runs-on: ubuntu-latest
if: github.event.review.state == 'approved'
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip yq
- name: Operator traffic light
id: op-traffic-light
env:
OP_TEST_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OP_TEST_PR_AUTHOR: "${{ github.event.review.user.login }}"
OPRT_REPO: "${{ github.event.pull_request.head.repo.full_name }}"
OPRT_SHA: "${{ github.event.pull_request.head.sha }}"
run: |
bash <(curl -sL https://raw.githubusercontent.com/operator-framework/operator-test-playbooks/master/upstream/test/oprt.sh)
- name: Author info
id: author
run: |
echo "github.event.review.user.login: ${{ github.event.review.user.login }}"
echo "steps.op-traffic-light.outputs.op_test_pr_revievers: ${{ steps.op-traffic-light.outputs.op_test_pr_revievers }}"
echo "steps.op-traffic-light.outputs.op_test_authorized_changes: ${{ steps.op-traffic-light.outputs.op_test_authorized_changes }}"
- name: "Setting authorized-changes label"
uses: actions/github-script@v3
if: steps.op-traffic-light.outputs.op_test_authorized_changes == '1'
continue-on-error: true
with:
github-token: ${{ secrets.FRAMEWORK_MERGE }}
script: |
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'authorized-changes' ]
})
# Please make it automatic (so we set recreate label)
- name: "Comment operator test error code [6]"
if: steps.op-traffic-light.outputs.op_test_authorized_changes == '1'
continue-on-error: true
uses: mshick/add-pr-comment@v1
with:
message: |
Changes were reviewed by `${{ github.event.review.user.login }}`. We are setting `authorized-changes` label
repo-token: ${{ secrets.FRAMEWORK_MERGE }}
repo-token-user-login: 'framework-automation' # The user.login for temporary GitHub tokens
allow-repeats: true