-
Notifications
You must be signed in to change notification settings - Fork 5.8k
63 lines (54 loc) · 2.22 KB
/
Copy patharm-auto-signoff-code.yaml
File metadata and controls
63 lines (54 loc) · 2.22 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: ARM Auto SignOff - Analyze Code
on:
pull_request:
types:
# default
- opened
- synchronize
- reopened
# re-run if base branch is changed, since previous merge commit may generate incorrect diff
- edited
paths:
# Always trigger on changes to WF itself
- ".github/**"
# Only trigger if PR includes at least one changed RM file, since this is only way WF can return "true"
# All consumers of workflow must treat "skipped" as equal to "completed false"
- "**/resource-manager/**"
permissions:
contents: read
jobs:
arm-auto-signoff-code:
name: ARM Auto SignOff - Analyze Code
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
# We compare HEAD (PR merge commit) against HEAD^ (base) via git diff,
# so we only need enough history to include the merge commit and its parent.
fetch-depth: 2
# Check only needs to view contents of changed files as a string, so can use
# "git show" on specific files instead of cloning whole repo
sparse-checkout: |
.github
- name: Install dependencies for github-script actions
uses: ./.github/actions/install-deps-github-script
- id: arm-auto-signoff-code
name: ARM Auto SignOff - Analyze Code
uses: actions/github-script@v8
with:
result-encoding: json
script: |
const { default: armAutoSignoffCode } =
await import('${{ github.workspace }}/.github/workflows/src/arm-auto-signoff/arm-auto-signoff-code.js');
return await armAutoSignoffCode({ github, context, core });
# Upload artifacts with individual results
- name: Upload artifact - ARM Auto Signoff Code Result (incremental)
uses: ./.github/actions/add-empty-artifact
with:
name: "incremental-typespec"
value: ${{ fromJSON(steps.arm-auto-signoff-code.outputs.result).incremental }}
- name: Upload artifact - ARM Auto Signoff Code Result (trivial)
uses: ./.github/actions/add-empty-artifact
with:
name: "trivial-changes"
value: ${{ fromJSON(steps.arm-auto-signoff-code.outputs.result).trivial }}