3939 - name : Fetch scanner's version API
4040 uses : mikefarah/yq@v4.4.1
4141 with :
42- cmd : echo versionApi=$(yq e .versionApi scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV
42+ cmd : echo versionApi=$(yq e .annotations. versionApi scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV
4343
4444 - name : Fetch latest release scanner version
4545 run : echo release=$((curl -sL ${{env.versionApi}} ) | jq -r ".tag_name") | tr -d "v" >> $GITHUB_ENV
@@ -60,13 +60,56 @@ jobs:
6060 echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
6161 echo prExists=$(gh pr list --state open --limit 100 | grep -F "$pullRequestTitle" -c) >> $GITHUB_ENV
6262
63- - name : Upgrade Scanner
63+ - name : Fetch new release changelog
64+ if : ${{ env.release != env.local }}
65+ run : echo releaseChangelog=$((curl -sL ${{env.versionApi}} ) | jq -r ".body") >> $GITHUB_ENV
66+
67+ - name : Upgrade Scanner Helm Chart
6468 if : ${{ env.release != env.local && env.prExists == 0 }}
6569 uses : mikefarah/yq@v4.4.1
6670 with :
6771 # appVersion value in chart is replaced with release value. Empty lines are deleted in the process
6872 cmd : yq e --inplace '.appVersion = "v${{env.release}}"' ./scanners/${{ matrix.scanner }}/Chart.yaml
6973
74+ # Updating Helm Docs
75+ - name : Download Helm Docs
76+ run : |
77+ mkdir helm-docs
78+ cd helm-docs
79+
80+ curl --output helm-docs.tar.gz --location https://github.com/norwoodj/helm-docs/releases/download/v1.5.0/helm-docs_1.5.0_Linux_x86_64.tar.gz
81+ # Checksum must be extracted from the checksum file every time helm-docs gets updated.
82+ echo "a352e13a8438045b8ed138b821cb757c177acd999c1af77345152d7a64b0ddb7 helm-docs.tar.gz" | shasum --check
83+
84+ tar -xvf helm-docs.tar.gz
85+ # Verify installation
86+ ./helm-docs --version
87+
88+ sudo mv helm-docs /usr/local/bin/helm-docs
89+
90+ - name : Generate README
91+ run : |
92+ make readme
93+ - name : Generate Demo-Apps Docs
94+ run : make demo-apps-docs
95+
96+ - name : Generate Hooks Docs
97+ run : make hook-docs
98+
99+ - name : Generate Scanner Docs
100+ run : make scanner-docs
101+
102+ - name : Generate Operator Docs
103+ run : make operator-docs
104+
105+ - name : Generate AutoDiscovery Docs
106+ run : make auto-discovery-docs
107+
108+ - name : Remove Helm Docs Files
109+ run : |
110+ # Remove helm-docs download to ensure they don't get committed back
111+ rm -rf helm-docs
112+
70113 - name : Create Pull Request
71114 if : ${{ env.release != env.local && env.prExists == 0 }}
72115 uses : peter-evans/create-pull-request@v3
78121 body : " This is an automated Pull Request by the SCB-Bot. It upgrades ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
79122 branch : " dependencies/upgrading-${{ matrix.scanner }}-to-${{env.release}}"
80123 labels : dependencies,scanner
81- commit-message : " Upgrading ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
124+ commit-message : |
125+ Upgrading ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}
126+ ## Release changes :
127+ ${{env.releaseChangelog}}
82128 signoff : true
83- base : main
129+ base : main
0 commit comments