-
Notifications
You must be signed in to change notification settings - Fork 521
51 lines (42 loc) · 1.56 KB
/
issue_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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Contains jobs corresponding to issue related checks.
name: Issue Checks
on:
issues:
types: [closed, reopened]
permissions:
issues: write
jobs:
script_check:
name: Closed TODO Issue Check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Bazel
uses: abhinavsingh/setup-bazel@v3
with:
version: 6.5.0
- name: TODO Issue Resolved Check
id: todoIssueResolvedCheck
if: ${{ github.event.action == 'closed' }}
run: |
bazel run //scripts:todo_issue_resolved_check -- $(pwd) ${{ github.event.issue.number }} ${{ github.sha }}
- name: Reopen Issue
if: failure() && steps.todoIssueResolvedCheck.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh issue reopen ${{ github.event.issue.number }}
- name: Check for duplicate comment
id: duplicateCommentCheck
if: failure() && steps.todoIssueResolvedCheck.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh issue view ${{ github.event.issue.number }} --json comments --jq '.comments[-1].body' > $(pwd)/latest_comment.txt
bazel run //scripts:todo_issue_comment_check -- $(pwd) latest_comment.txt script_failures.txt
- name: Add Comment
if: failure() && steps.duplicateCommentCheck.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh issue comment ${{ github.event.issue.number }} -F $(pwd)/script_failures.txt