-
Notifications
You must be signed in to change notification settings - Fork 127
54 lines (44 loc) · 1.48 KB
/
gen-docs.yml
File metadata and controls
54 lines (44 loc) · 1.48 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
name: "Generate docs"
on:
push:
branches:
- main
paths:
- "src/Microsoft.ComponentDetection.Orchestrator/ArgumentSets/*.cs"
permissions:
contents: read
jobs:
gen-docs:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # zizmor: ignore[artipacked] git-auto-commit-action needs credentials to push
- name: Setup .NET Core
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
- name: Generate docs
run: |
touch version.json
touch version_dev.json
# Run CLI
dotnet run -p src/Microsoft.ComponentDetection help scan 2> help.txt || true
cat <<EOF > docs/detector-arguments.md
# Detector arguments
\`\`\`shell
dotnet run -p './src/Microsoft.ComponentDetection' help scan
\`\`\`
\`\`\`
$(tail --lines=+4 help.txt)
\`\`\`
EOF
- name: Commit
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
with:
commit_message: "Update docs"
file_pattern: "*.md"