Skip to content

Commit

Permalink
chore: scan only latest tag
Browse files Browse the repository at this point in the history
Signed-off-by: Ved Ratan <[email protected]>
  • Loading branch information
VedRatan committed Aug 1, 2024
1 parent 4e034d3 commit 9f658c7
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/nightly-scan-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,14 @@ jobs:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
matrix:
branch:
- main

steps:
- name: Checkout ${{ matrix.branch }} branch
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
lfs: true

- name: Get latest tag on branch
shell: bash
run: |
BRANCH_NAME=${{ matrix.branch }}
LATEST_TAG=$(git tag --merged ${BRANCH_NAME} --sort=-creatordate | head -n 1)
echo "IMAGE_TAG=${LATEST_TAG}" >> $GITHUB_ENV
- name: Log into registry ${{env.REGISTRY}}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
Expand All @@ -47,7 +34,7 @@ jobs:

- name: Set Image name
run: |
echo IMAGE_NAME="ghcr.io/nirmata/kyverno-notation-aws:${{ env.IMAGE_TAG }}" >> $GITHUB_ENV
echo IMAGE_NAME="ghcr.io/nirmata/kyverno-notation-aws:latest" >> $GITHUB_ENV
- name: Scan image using grype
id: grype-scan
Expand Down

0 comments on commit 9f658c7

Please sign in to comment.