Skip to content

Commit

Permalink
RS-XX: Try to recover pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
w-jka committed Jan 5, 2024
1 parent 6a1da91 commit 63a7d91
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
53 changes: 26 additions & 27 deletions .github/actions/generate-report/action.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
name: 'Generate Vulnerabilities Report'
description: 'Generate Vulnerabilities Report'
name: "Generate Vulnerabilities Report"
description: "Generate Vulnerabilities Report"
inputs:
COMPONENT:
description: 'Component to generate the Anchore Report for'
description: "Component to generate the Anchore Report for"
required: true

runs:
using: "composite"
steps:
- name: Download json report from build jobs
uses: actions/[email protected]
with:
name: vulnerabilities-${{ inputs.COMPONENT }}

- name: Download json report from build jobs
uses: actions/download-artifact@v2
with:
name: vulnerabilities-${{ inputs.COMPONENT }}
- name: Generate CSV and intermediate HTML report
shell: bash
run: |
echo "SEVERITY;ID;PACKAGE;VERSION;LINK" > vulnerabilities.csv
cat vulnerabilities.json | jq -r '.matches[] | "\(.vulnerability.severity);\(.vulnerability.id);\(.artifact.name);\(.artifact.version);\(.vulnerability.links[0])"' >> vulnerabilities.csv
echo -e '<table>\n<thead>\n<tr class="header">\n<th><p>SEVERITY</p></th>\n<th><p>ID</p></th>\n<th><p>PACKAGE</p></th>\n<th><p>VERSION</p></th>\n</tr>\n</thead>\n<tbody>' > vulnerabilities.html
cat vulnerabilities.json | jq -r '.matches[] | "<tr>;<td><p>\(.vulnerability.severity)</p></td>;<td><p><a href=\"\(.vulnerability.links[0])\">\(.vulnerability.id)</a></p></td>;<td><p>\(.artifact.name)</p></td>;<td><p>\(.artifact.version)</p></td>;</tr>"' | tr -s ';' '\n' | sed 's!><p>Negligible! style="background-color:#FFFFFF;"><p>Negligible!g' | sed 's!><p>Low! style="background-color:#FFFC9E;"><p>Low!g' | sed 's!><p>Medium! style="background-color:#FE996B;"><p>Medium!g' | sed 's!><p>High! style="background-color:#FD6864;"><p>High!g' | sed 's!><p>Critical! style="background-color:#FE0000;"><p>Critical!g' >> vulnerabilities.html
echo -e '</tbody>\n</table>' >> vulnerabilities.html
- name: Generate CSV and intermediate HTML report
shell: bash
run: |
echo "SEVERITY;ID;PACKAGE;VERSION;LINK" > vulnerabilities.csv
cat vulnerabilities.json | jq -r '.matches[] | "\(.vulnerability.severity);\(.vulnerability.id);\(.artifact.name);\(.artifact.version);\(.vulnerability.links[0])"' >> vulnerabilities.csv
echo -e '<table>\n<thead>\n<tr class="header">\n<th><p>SEVERITY</p></th>\n<th><p>ID</p></th>\n<th><p>PACKAGE</p></th>\n<th><p>VERSION</p></th>\n</tr>\n</thead>\n<tbody>' > vulnerabilities.html
cat vulnerabilities.json | jq -r '.matches[] | "<tr>;<td><p>\(.vulnerability.severity)</p></td>;<td><p><a href=\"\(.vulnerability.links[0])\">\(.vulnerability.id)</a></p></td>;<td><p>\(.artifact.name)</p></td>;<td><p>\(.artifact.version)</p></td>;</tr>"' | tr -s ';' '\n' | sed 's!><p>Negligible! style="background-color:#FFFFFF;"><p>Negligible!g' | sed 's!><p>Low! style="background-color:#FFFC9E;"><p>Low!g' | sed 's!><p>Medium! style="background-color:#FE996B;"><p>Medium!g' | sed 's!><p>High! style="background-color:#FD6864;"><p>High!g' | sed 's!><p>Critical! style="background-color:#FE0000;"><p>Critical!g' >> vulnerabilities.html
echo -e '</tbody>\n</table>' >> vulnerabilities.html
- name: Convert HTLM to PDF
uses: docker://ghcr.io/coprs/reference-system:dependencies_wkhtmltopdf
with:
args: vulnerabilities.html vulnerabilities.pdf
- name: Convert HTLM to PDF
uses: docker://ghcr.io/coprs/reference-system:dependencies_wkhtmltopdf
with:
args: vulnerabilities.html vulnerabilities.pdf

- name: Upload Anchore scan reports
uses: actions/upload-artifact@master
with:
name: vulnerabilities-${{ inputs.COMPONENT }}
path: |
vulnerabilities.csv
vulnerabilities.pdf
- name: Upload Anchore scan reports
uses: actions/upload-artifact@master
with:
name: vulnerabilities-${{ inputs.COMPONENT }}
path: |
vulnerabilities.csv
vulnerabilities.pdf
2 changes: 1 addition & 1 deletion rs-core/ingestion-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG COMMIT_ID
ARG BRANCH_TEXT

WORKDIR /app

RUN echo "${VERSION}" >> VERSION
RUN echo "${BRANCH_TEXT}" >> VERSION
RUN echo "${COMMIT_ID}" >> VERSION
Expand Down

0 comments on commit 63a7d91

Please sign in to comment.