-
Notifications
You must be signed in to change notification settings - Fork 610
75 lines (64 loc) · 2.34 KB
/
check-rli.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Check RLIs
on: [pull_request]
jobs:
check-rlis:
runs-on: ubuntu-latest
steps:
- name: Checkout frc-docs
uses: actions/checkout@v2
with:
repository: wpilibsuite/frc-docs
# Replace with current version
- name: Use PR version
run: |
# Filter source entries, setting the latest version
cat '.github/workflows/inspector.json' \
| jq '.sources |= map(select (.baseUrl | test("wpilibsuite/allwpilib")) | .latestVersion |= "${{ github.event.pull_request.head.sha }}")' \
| tee '.github/workflows/inspector.json'
# Run Inspector
- name: Inspect RLIs
uses: docker://ghcr.io/starlight220/inspector:v1.9
id: inspector
with:
root: ${{ github.workspace }}
env:
INSPECTOR_CONFIG: '.github/workflows/inspector.json'
# Error if RLIs can't be automatically updated
- name: Set exit code
if: ${{ steps.inspector.outputs.needs-manual == 'true' }}
run: exit 1
# ---- Post Report ----
- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
if: failure()
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Inspector Report
direction: last
- name: Create comment
if: ${{ failure() && steps.fc.outputs.comment-id == 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
body: ${{ env.REPORT }}
issue-number: ${{ github.event.pull_request.number }}
- name: Update comment
if: ${{ failure() && steps.fc.outputs.comment-id != 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
body: |
### Found RLIs needing manual updates!
<details>
<summary>See the "needs manual updates" section of the report:</summary>
${{ env.REPORT }}
</summary>
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
- name: Update comment
if: ${{ success() && steps.fc.outputs.comment-id != 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
body: All RLIs fixed!
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace