21
21
jobs :
22
22
check-binary :
23
23
runs-on : ubuntu-latest
24
- # outputs:
25
- # vulnerability : ${{steps.laststep .outputs}}
24
+ outputs :
25
+ report_contents : ${{ steps.save-output .outputs.report_contents }}
26
26
steps :
27
27
- uses : actions/setup-python@v5
28
28
with :
@@ -33,24 +33,48 @@ jobs:
33
33
latest : true
34
34
fileName : ' aws-lambda-rie*'
35
35
out-file-path : " bin"
36
- - name : check-binaries
37
- run : make check-binaries
38
- - id : laststep
39
- run : cat $(ls -tr *.csv 2>/dev/null | tail -n1) >> "$GITHUB_OUTPUT"
40
- # - id: laststep
41
- # run: cat $(ls -tr *.csv 2>/dev/null | tail -n1) >> "$GITHUB_OUTPUT"
42
- # create-issue:
43
- # runs-on: ubuntu-latest
44
- # needs: check-binary
45
- # if: always() && needs.check-binary.outputs != ""
46
- # steps:
47
- # - name: Create Issue
48
- # uses: dacbd/create-issue-action@main
49
- # with:
50
- # token: ${{ github.token }}
51
- # title: |
52
- # CVEs found in latest RIE binaries
53
- # body: |
54
- # ## CVEs found in latest RIE binaries:
55
- # > **${{ needs.check-binary.outputs}}**
36
+ - name : Run check for vulnerabilities
37
+ id : check-binaries
38
+ run : |
39
+ make check-binaries
40
+ - if : always() && failure() # Failure means there are vulnerabilities
41
+ id : save-output
42
+ name : Save output contents
43
+ run : |
44
+ report_csv="$(cat $(ls -tr output.cve-bin-*.csv 2>/dev/null | tail -n1))" # last file generated
45
+ report="${report_csv}.txt"
46
+ awk -F',' '{n=split($10, path, "/"); print $2,$3,$4,$5,path[n]}' "$report_csv" | column -t > "$report" # make the CSV nicer
47
+ echo "report_contents=$(cat $report)" >> "$GITHUB_OUTPUT"
48
+ create-issue :
49
+ runs-on : ubuntu-latest
50
+ needs : check-binary
51
+ if : always() && needs.check-binary.outputs.report_contents != ''
52
+ steps :
53
+ - name : Build new version and check
54
+ id : check-new-version
55
+ run : |
56
+ make compile-with-docker-all
57
+ latest_version=$(strings bin/aws-lambda-rie* | grep '^go1\.' | uniq)
58
+ echo "latest_version=$latest_version"
59
+ make check_binaries
60
+ exit_code=$?
61
+ if [ "$exit_code" != "0" ]; then
62
+ fixed="No"
63
+ else
64
+ fixed="Yes"
65
+ fi
66
+ echo fixed=$fixed" >> "$GITHUB_OUTPUT"
67
+
68
+ - name : Create Issue
69
+ id : create-issue
70
+ uses : dacbd/create-issue-action@main
71
+ with :
72
+ token : ${{ github.token }}
73
+ title : |
74
+ CVEs found in latest RIE release
75
+ body : |
76
+ ## CVEs found in latest RIE release:
77
+ > **${{ needs.check-binary.outputs.report_contents }}**
56
78
79
+ #### Is this fixed by updating to the latest Go version (${{steps.check-new-version.outputs.latest_version}})?):
80
+ ${{ steps.check-new-version.outputs.fixed }}
0 commit comments