-
-
Notifications
You must be signed in to change notification settings - Fork 443
69 lines (54 loc) · 2.17 KB
/
docgenerator.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
name: MASVS Build
on: [push, workflow_dispatch]
jobs:
Generate-MASVS-Documents:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set MASVS_VERSION to env
run: echo "MASVS_VERSION=$(curl -s https://api.github.com/repos/OWASP/owasp-masvs/tags | jq '.[0].name' | sed 's/\"//g')" >> $GITHUB_ENV
- name: Set DEV MASVS_VERSION if it's not a tag
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "MASVS_VERSION=${{env.MASVS_VERSION}}-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Get Latest MASTG Release Tag
run: echo "MASTG_VERSION=$(curl -s https://api.github.com/repos/OWASP/owasp-mastg/releases/latest | jq '.tag_name' | sed 's/\"//g')" >> $GITHUB_ENV
- name: Generate MASVS yaml
run: python3 ./tools/generate_masvs_yaml.py -v ${{ env.MASVS_VERSION }}
- name: Populate MASVS Categories Markdown Files
run: python3 ./tools/populate_masvs_categories_md.py
- name: Generate PDF and ePub
run: ./tools/docker/pandoc_makedocs.sh Document ${{ env.MASVS_VERSION }} ${{ env.MASTG_VERSION }}
- name: Generate CycloneDX JSON
run: python3 ./tools/generate_masvs_cyclonedx.py
- name: Generate SARIF
run: python3 ./tools/generate_masvs_sarif.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: OWASP_MASVS
path: OWASP_MASVS*
release:
runs-on: ubuntu-latest
needs: [Generate-MASVS-Documents]
if: startsWith(github.ref, 'refs/tags/') && (github.actor == 'cpholguera' || github.actor == 'sushi2k')
steps:
- uses: actions/download-artifact@v4
- name: Move all files to the root folder
run: mv OWASP_MASVS*/* .
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: false
draft: true
generate_release_notes: true
discussion_category_name: Announcements
files: |
OWASP_MASVS.pdf
OWASP_MASVS.epub
OWASP_MASVS.yaml
OWASP_MASVS.cdx.json
OWASP_MASVS.sarif
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}