Skip to content

Commit

Permalink
ci(patch): test
Browse files Browse the repository at this point in the history
Signed-off-by: r3drun3 <[email protected]>
  • Loading branch information
R3DRUN3 committed Apr 18, 2024
1 parent 5372780 commit 6938d4d
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@ jobs:
username: ${{ secrets.SIGHUP_REGISTRY_USERNAME }}
password: ${{ secrets.SIGHUP_REGISTRY_PASSWORD }}

- name: Set Image Tag
id: set_tag
run: |
TAG=$(echo "${{ matrix.target }}" | grep -o '[^:]*$')
IMMUNIZED_TAG="${TAG}"
PATCHED_TAG_SBOM=$(echo "${{ matrix.target }}" | tr '/:' '-')
IMAGE_NAME=$(echo "${{ matrix.target }}" | sed -E 's|.*/([^:/]+/[^:/]+).*|\1|')
echo "PATCHED_TAG=${IMMUNIZED_TAG}" >> $GITHUB_ENV
echo "PATCHED_TAG_SBOM=${PATCHED_TAG_SBOM}" >> $GITHUB_ENV
echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV
- name: Generate Trivy Report
id: trivy
continue-on-error: true
uses: aquasecurity/trivy-action@69cbbc0cbbf6a2b0bab8dcf0e9f2d7ead08e87e4
with:
scan-type: 'image'
Expand All @@ -63,23 +73,12 @@ jobs:

- name: Check Vuln Count
id: vuln_count
continue-on-error: true
run: |
report_file="report.json"
vuln_count=$(jq '.Results | length' "$report_file")
echo "vuln_count=$vuln_count" >> $GITHUB_OUTPUT
echo $vuln_count
- name: Set Image Tag
id: set_tag
run: |
TAG=$(echo "${{ matrix.target }}" | grep -o '[^:]*$')
IMMUNIZED_TAG="${TAG}"
PATCHED_TAG_SBOM=$(echo "${{ matrix.target }}" | tr '/:' '-')
IMAGE_NAME=$(echo "${{ matrix.target }}" | sed -E 's|.*/([^:/]+/[^:/]+).*|\1|')
echo "PATCHED_TAG=${IMMUNIZED_TAG}" >> $GITHUB_ENV
echo "PATCHED_TAG_SBOM=${PATCHED_TAG_SBOM}" >> $GITHUB_ENV
echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV
- name: Copa Action
# if: steps.vuln_count.outputs.vuln_count != '0'
Expand Down

0 comments on commit 6938d4d

Please sign in to comment.