Skip to content

Commit

Permalink
[nc] iterate on artifact creation and upload
Browse files Browse the repository at this point in the history
Signed-off-by: Nic Cheneweth <nchenewe@thoughtworks.com>
  • Loading branch information
ncheneweth committed Oct 21, 2024
1 parent 6f46a17 commit fc16d77
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions grype-scan/action.yaml
Original file line number Diff line number Diff line change
@@ -55,6 +55,23 @@ runs:
working-directory: ${{ inputs.working-directory }}
shell: bash
run: |
grype --fail-on ${{ inputs.grype-severity }} \
#!/usr/bin/env bash
set -eo pipefail
outfilename="${{ inputs.image }}_${{ inputs.tag }}_grype_scan.log"
echo "outfilename=$outfilename" >> $GITHUB_ENV
exitcode="--fail-on ${{ inputs.grype-severity }}"
if [[ "${{ inputs.security-scan-nofail }}" == "true" ]]; then
exitcode=""
fi
grype $exitcode \
${{ inputs.grype-additional-args }} \
${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.image }}:${{ inputs.tag }}
${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.image }}:${{ inputs.tag }} 2>&1 | tee $outfilename
- name: upload grypw scan log as saved artifact
if: ${{ inputs.security-scan-nofail == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.outfilename }}
path: ${{ env.outfilename }}
retention-days: 7

Check failure on line 77 in grype-scan/action.yaml

GitHub Actions / static code analysis / gha-tools-action static code analysis workflow

77:26 [new-line-at-end-of-file] no new line character at the end of file

0 comments on commit fc16d77

Please sign in to comment.