Skip to content

Commit cd701ec

Browse files
committed
Only fixed vulnerabilities
Signed-off-by: sandhi <sagarwal@progress.com>
1 parent 8f945f5 commit cd701ec

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/grype-hab-package-scan.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ jobs:
153153
if: ${{ inputs.build_package == true }}
154154
run: |
155155
source results/last_build.env
156-
cat results/last_build.env
157156
echo "BUILT_PACKAGE=${pkg_ident}" >> $GITHUB_ENV
158157
echo "BUILT_PKG_PATH=/hab/pkgs/${pkg_ident}" >> $GITHUB_ENV
159158
echo "Built package: ${pkg_ident}"
@@ -166,7 +165,8 @@ jobs:
166165
167166
- name: Generate Artifact Name
168167
run: |
169-
ARTIFACT_NAME=$(echo "grype-scan-linux-${{ inputs.hab_package }}" | sed 's|/|-|g')
168+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
169+
ARTIFACT_NAME=$(echo "grype-scan-linux-${{ inputs.hab_package }}-${TIMESTAMP}" | sed 's|/|-|g')
170170
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
171171
172172
- name: Install Habitat Package (Linux)
@@ -197,13 +197,6 @@ jobs:
197197
echo "Installing: ${INSTALL_CMD}"
198198
eval ${INSTALL_CMD}
199199
200-
- name: Debug data
201-
if: ${{ inputs.build_package == true }}
202-
run: |
203-
echo "Package to scan: ${BUILT_PACKAGE}"
204-
echo "Pkg path $(ls /hab/pkgs)"
205-
echo "Contents: $(ls /hab/pkgs/${BUILT_PACKAGE})"
206-
207200
- name: Run Grype Scan on Habitat Package
208201
timeout-minutes: 15
209202
run: |
@@ -335,7 +328,6 @@ jobs:
335328
if: ${{ inputs.build_package == true }}
336329
run: |
337330
. ./results/last_build.ps1
338-
cat ./results/last_build.ps1
339331
$PkgIdentPath = $pkg_ident -replace '/', '\'
340332
$RepoName = "${{ github.event.repository.name }}"
341333
$InstalledPath = "D:\hab\studios\a--${RepoName}--${RepoName}\hab\pkgs\$PkgIdentPath"
@@ -370,7 +362,8 @@ jobs:
370362
371363
- name: Generate Artifact Name
372364
run: |
373-
$ArtifactName = "grype-scan-windows-${{ inputs.hab_package }}"
365+
$Timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
366+
$ArtifactName = "grype-scan-windows-${{ inputs.hab_package }}-$Timestamp"
374367
$ArtifactName = $ArtifactName -replace '/', '-'
375368
echo "ARTIFACT_NAME=$ArtifactName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
376369
@@ -555,7 +548,8 @@ jobs:
555548
556549
- name: Generate Artifact Name
557550
run: |
558-
ARTIFACT_NAME=$(echo "grype-scan-macos-${{ inputs.hab_package }}" | sed 's|/|-|g')
551+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
552+
ARTIFACT_NAME=$(echo "grype-scan-macos-${{ inputs.hab_package }}-${TIMESTAMP}" | sed 's|/|-|g')
559553
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
560554
561555
- name: Install Habitat Package (MacOS)

.github/workflows/grype.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ jobs:
4545
run: |
4646
curl -sSfL https://get.anchore.io/grype | sh -s -- -b /usr/local/bin
4747
48+
- name: Generate Artifact Name
49+
run: |
50+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
51+
ARTIFACT_NAME=$(echo "grype-scan-${{ github.event.repository.name }}-${TIMESTAMP}" | sed 's|/|-|g')
52+
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
53+
4854
- name: Configure AWS credentials
4955
uses: aws-actions/configure-aws-credentials@v4
5056
if: ${{ !inputs.grype-image-skip-aws }}
@@ -169,7 +175,7 @@ jobs:
169175
if: always()
170176
uses: actions/upload-artifact@v4
171177
with:
172-
name: grype-scan-results
178+
name: ${{ env.ARTIFACT_NAME }}
173179
path: |
174180
grype-scan.json
175181
grype-scan.log

0 commit comments

Comments
 (0)