-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (47 loc) · 1.88 KB
/
codegen_check.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
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
pull_request:
types: [opened, synchronize, reopened]
# Declare default permissions as read only.
permissions: read-all
name: Code Generation Check
jobs:
check-codegen:
permissions:
pull-requests: write
strategy:
matrix:
target: [ mocks, protobuf ]
fail-fast: false # Don't cancel running checks because one fails
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- uses: jdx/mise-action@53d027c2e96fed8f955f5d95bff910a3e031cc58 # v2.1.6
with:
experimental: true
- id: generate
run: mise run generate:${{ matrix.target }} --check
continue-on-error: true
- name: Comment PR - Failure
if: steps.generate.outcome == 'failure'
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
with:
comment_tag: 'code_gen_${{ matrix.target }}'
mode: upsert
message: |
Generating the ${{ matrix.target }} code failed. This could be an indicator that the code generation is not up to date.
Please review the failed action before deciding to merge the PR.
- name: Comment PR - Success
if: steps.generate.outcome != 'failure'
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
with:
comment_tag: 'code_gen_${{ matrix.target }}'
mode: delete
message: "The content of this message means nothing as the action will delete a message, not post it - I don't know why a message is needed here."