-
Notifications
You must be signed in to change notification settings - Fork 92
49 lines (40 loc) · 1.26 KB
/
gen-docs.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
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:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.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@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_message: 'Update docs'
file_pattern: '*.md'