Skip to content

Commit

Permalink
Restructure summary
Browse files Browse the repository at this point in the history
  • Loading branch information
VOID404 committed Aug 21, 2024
1 parent f10d605 commit 9d635b1
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/compass-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ jobs:
go-version-file: go.mod
- name: Run unit tests
run: make test | tee test.log
- name: Generate summary
if: success() || failure()
run: |
{
echo '## Test Log'
echo '```'
cat test.log
echo '```'
} >> $GITHUB_STEP_SUMMARY
- name: Upload test logs artifact
uses: actions/upload-artifact@v4
if: success() || failure()
Expand Down Expand Up @@ -102,20 +111,18 @@ jobs:
timeout: '5m0s'
vuln-type: 'os,library'

format: json
output: 'trivy-results.json'

- name: Convert results
format: table
output: 'trivy-results.txt'
- name: Generate summary
if: success() || failure()
run: |
./trivy/trivy convert -f table -o trivy-results.txt trivy-results.json
./trivy/trivy convert -f sarif -o trivy-results.sarif trivy-results.json
- name: Upload Trivy scan results to GitHub Security tab
if: (success() || failure()) && github.ref == 'refs/heads/main'
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
{
echo '## Trivy'
echo '```txt'
cat trivy-results.txt
echo '```'
} >> $GITHUB_STEP_SUMMARY
- name: Upload trivy table
if: success() || failure()
Expand All @@ -134,31 +141,13 @@ jobs:
context: .
tags: ${{ needs.setup.outputs.tag }}

summary:
print-images:
runs-on: ubuntu-latest
needs: [setup, build-image, unit-tests, trivy]
if: success() || failure()
needs: build-image
steps:
- name: "Download test log"
uses: actions/download-artifact@v4
with:
name: test.log
- name: "Download trivy log"
uses: actions/download-artifact@v4
with:
name: trivy-results.txt
- name: "Generate summary"
run: |
{
echo '# Compass Manager'
echo '## Trivy'
echo '```txt'
cat trivy-results.txt
echo '```'
echo '## Test Log'
echo '```'
cat test.log
echo '```'
echo '## Images'
echo '```json'
echo '${{ needs.build-image.outputs.images }}' | jq
Expand Down

0 comments on commit 9d635b1

Please sign in to comment.