Skip to content

Commit

Permalink
Improve step names
Browse files Browse the repository at this point in the history
  • Loading branch information
valerena committed May 23, 2024
1 parent 0e12664 commit be0625b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/check-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ jobs:
outputs:
report_contents: ${{ steps.save-output.outputs.report_contents }}
steps:
- uses: actions/setup-python@v5
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
- uses: robinraju/[email protected]
- name: Download latest release
uses: robinraju/[email protected]
with:
latest: true
fileName: 'aws-lambda-rie*'
Expand All @@ -26,19 +29,19 @@ jobs:
id: check-binaries
run: |
make check-binaries
- if: always() && failure() # Failure means there are vulnerabilities
- if: always() && failure() # `always()` to run even if the previous step failed. Failure means that there are vulnerabilities
name: Save content of the vulnerabilities report as GitHub output
id: save-output
name: Save output contents
run: |
report_csv="$(ls -tr output.cve-bin-*.csv 2>/dev/null | tail -n1)" # last file generated
echo "Vulnerabilities stored in $report_csv"
final_report="${report_csv}.txt"
awk -F',' '{n=split($10, path, "/"); print $2,$3,$4,$5,path[n]}' "$report_csv" | column -t > "$final_report" # make the CSV nicer
echo "report_contents<<EOF" >> "$GITHUB_OUTPUT"
cat "$final_report" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
cat "$final_report" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- if: always() && steps.check-binaries.outcome == 'failure'
name: Build new version and check
name: Build new binaries and check vulnerabilities again
id: check-new-version
run: |
mkdir ./bin2
Expand All @@ -48,18 +51,17 @@ jobs:
echo "latest_version=$latest_version" >> "$GITHUB_OUTPUT"
make check-binaries
- if: always() && steps.check-binaries.outcome == 'failure'
name: Save output for new version
name: Save outputs for the check with the latest build
id: save-new-version
run: |
exit_code=$?
if [ "${{ steps.check-new-version.outcome }}" == "failure" ]; then
fixed="No"
else
fixed="Yes"
fi
echo "fixed=$fixed" >> "$GITHUB_OUTPUT"
- if: always() && steps.check-binaries.outcome == 'failure'
name: Create Issue
name: Create GitHub Issue indicating vulnerabilities
id: create-issue
uses: dacbd/create-issue-action@main
with:
Expand Down

0 comments on commit be0625b

Please sign in to comment.