Skip to content

Commit 0dd6cea

Browse files
authored
skipping pdf gen
1 parent 7d64927 commit 0dd6cea

1 file changed

Lines changed: 58 additions & 27 deletions

File tree

.github/workflows/actions.yml

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,66 @@ jobs:
4848
path: ${{ github.workspace }}/vulRep.html
4949
- name: Debug File Paths
5050
run: ls -lah ${{ github.workspace }}/
51-
- name: Install Dependency
52-
run: |
53-
sudo apt-get install -y wkhtmltopdf
54-
- name: Generate PDFs
55-
run: |
56-
if [ -f "${{ github.workspace }}/sbom.json" ]; then
57-
cat ${{ github.workspace }}/sbom.json | jq '.' > ${{ github.workspace }}/sbom_pretty.json
58-
echo "<html><body><pre>$(cat ${{ github.workspace }}/sbom_pretty.json)</pre></body></html>" > ${{ github.workspace }}/sbom.html
59-
# Removed --enable-local-file-access as it's just a local file
60-
wkhtmltopdf "${{ github.workspace }}/sbom.html" "${{ github.workspace }}/sbom.pdf"
61-
else
62-
echo "sbom.json not found, skipping SBOM PDF generation."
63-
fi
51+
- name: Mail Notification
52+
uses: dawidd6/action-send-mail@v3
53+
with:
54+
server_address: smtp.gmail.com
55+
server_port: 587
56+
username: ${{ secrets.GMAIL_USERNAME }}
57+
password: ${{ secrets.GMAIL_PASSWORD }}
58+
to: divijs75@gmail.com, divyanshbisht2005@gmail.com, akashsah2003@gmail.com
59+
from: divyanshbisht2005@gmail.com
60+
subject: "Security Report Generation Complete for ${{ github.repository }}"
61+
body: |
62+
Hello,
63+
64+
A new security report has been generated for the repository: `${{ github.repository }}`.
65+
66+
**Details:**
67+
- Workflow Run ID: `${{ github.run_id }}`
68+
- Workflow Run Number: `${{ github.run_number }}`
69+
- Commit SHA: `${{ github.sha }}`
70+
- Branch: `${{ github.ref_name }}`
71+
- Generated At: $(date)
72+
73+
The following artifacts have been uploaded to this workflow run and can be downloaded from the "Summary" tab of the workflow run on GitHub:
74+
- SBOM (Software Bill of Materials): `sbom-${{ github.run_id }}-${{ github.run_number }}.json`
75+
- Vulnerability Disclosure Report (if generated): `vulRep-${{ github.run_id }}-${{ github.run_number }}.vdr.json`
76+
- HTML Vulnerability Report: `vulRep-${{ github.run_id }}-${{ github.run_number }}.html`
77+
78+
Please log in to SBOMgen dashboard or GitHub to review the generated reports.
79+
80+
Best regards,
81+
SBOMGen
82+
# - name: Install Dependency
83+
# run: |
84+
# sudo apt-get install -y wkhtmltopdf
85+
# - name: Generate PDFs
86+
# run: |
87+
# if [ -f "${{ github.workspace }}/sbom.json" ]; then
88+
# cat ${{ github.workspace }}/sbom.json | jq '.' > ${{ github.workspace }}/sbom_pretty.json
89+
# echo "<html><body><pre>$(cat ${{ github.workspace }}/sbom_pretty.json)</pre></body></html>" > ${{ github.workspace }}/sbom.html
90+
# # Removed --enable-local-file-access as it's just a local file
91+
# wkhtmltopdf "${{ github.workspace }}/sbom.html" "${{ github.workspace }}/sbom.pdf"
92+
# else
93+
# echo "sbom.json not found, skipping SBOM PDF generation."
94+
# fi
6495

65-
if [ -f "${{ github.workspace }}/sbom.vdr.json" ]; then
66-
cat ${{ github.workspace }}/sbom.vdr.json | jq '.' > ${{ github.workspace }}/sbomv_pretty.json
67-
echo "<html><body><pre>$(cat ${{ github.workspace }}/sbomv_pretty.json)</pre></body></html>" > ${{ github.workspace }}/sbomv.html
68-
wkhtmltopdf "${{ github.workspace }}/sbomv.html" "${{ github.workspace }}/sbomv.pdf"
69-
else
70-
echo "sbom.vdr.json not found, skipping VDR PDF generation."
71-
touch ${{ github.workspace }}/sbomv.pdf
72-
fi
96+
# if [ -f "${{ github.workspace }}/sbom.vdr.json" ]; then
97+
# cat ${{ github.workspace }}/sbom.vdr.json | jq '.' > ${{ github.workspace }}/sbomv_pretty.json
98+
# echo "<html><body><pre>$(cat ${{ github.workspace }}/sbomv_pretty.json)</pre></body></html>" > ${{ github.workspace }}/sbomv.html
99+
# wkhtmltopdf "${{ github.workspace }}/sbomv.html" "${{ github.workspace }}/sbomv.pdf"
100+
# else
101+
# echo "sbom.vdr.json not found, skipping VDR PDF generation."
102+
# touch ${{ github.workspace }}/sbomv.pdf
103+
# fi
73104

74-
if [ -f "${{ github.workspace }}/vulRep.html" ]; then
75-
wkhtmltopdf --disable-javascript --enable-local-file-access "${{ github.workspace }}/vulRep.html" "${{ github.workspace }}/vulRep.pdf"
76-
else
77-
echo "vulRep.html not found, skipping HTML report PDF generation."
78-
touch ${{ github.workspace }}/vulRep.pdf
79-
fi
105+
# if [ -f "${{ github.workspace }}/vulRep.html" ]; then
106+
# wkhtmltopdf --disable-javascript --enable-local-file-access "${{ github.workspace }}/vulRep.html" "${{ github.workspace }}/vulRep.pdf"
107+
# else
108+
# echo "vulRep.html not found, skipping HTML report PDF generation."
109+
# touch ${{ github.workspace }}/vulRep.pdf
110+
# fi
80111

81112
# - name: Mail Reports
82113
# uses: dawidd6/action-send-mail@v3

0 commit comments

Comments
 (0)