Skip to content

Commit 461fc3b

Browse files
committed
Generating index.html automatically
1 parent 62cd9ff commit 461fc3b

6 files changed

Lines changed: 23 additions & 7281 deletions

File tree

.github/workflows/scan-release.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
env:
3636
GH_TOKEN: ${{ github.token }}
3737
RELEASE: ${{ inputs.release }}
38-
run: ./download-release.sh
38+
run: |
39+
./download-release.sh
40+
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
3941
4042
- name: Setup Python
4143
uses: actions/setup-python@v5
@@ -64,15 +66,6 @@ jobs:
6466
vtscan-results-all.json
6567
vtscan-results-warnings.json
6668
67-
# - name: Post message
68-
# uses: slackapi/slack-github-action@v2.0.0
69-
# with:
70-
# method: chat.postMessage
71-
# token: ${{ secrets.SLACK_BOT_TOKEN }}
72-
# payload: |
73-
# channel: ${{ secrets.SLACK_CHANNEL_ID }}
74-
# text: "${{ env.SCAN_STATUS }}"
75-
7669
upload:
7770
# Making it a standalone job to limit its security perimeter
7871
runs-on: ubuntu-latest
@@ -95,10 +88,15 @@ jobs:
9588
- name: Commit scan results
9689
shell: bash
9790
run: |
91+
mv vtscan-results-all.json "vt-scan-results/$RELEASE-all.json"
92+
mv vtscan-results-warning.json "vt-scan-results/$RELEASE-warning.json"
93+
94+
python3 html.py > index.html
95+
9896
git config --local user.email "github-actions[bot]@users.noreply.github.com"
9997
git config --local user.name "github-actions[bot]"
10098
git add .
101-
git commit -a -m "VT scan results"
99+
git commit -a -m "Updated VT scan results"
102100
103101
- name: Push changes
104102
uses: ad-m/github-push-action@master

download-release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ else
3333
echo "Release variable is specified"
3434
fi
3535

36+
export RELEASE
37+
3638
echo "Downloading binaries for release $RELEASE to $(pwd)"
3739

3840
gh release download "$RELEASE" --clobber --dir "$OUTPUT" --pattern "*.exe" --repo "$REPO"

html.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import datetime
2+
import os
3+
4+
if __name__ == '__main__':
5+
print('<h1>VirusTotal scan results for <a href="https://flowkeeper.org">Flowkeeper</a></h1>')
6+
print('<ul>')
7+
for f in os.listdir('vt-scan-results'):
8+
if f.endswith('.json'):
9+
print(f'<li><a href="vt-scan-results/{f}">{f}</a></li>')
10+
print('</ul>')
11+
print(f'<p>Last update: {datetime.datetime.now(tz=datetime.timezone.utc)}</p>')

vt-scan-results/DO NOT DELETE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aa

0 commit comments

Comments
 (0)