Skip to content

Commit

Permalink
updating tag logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yajith committed Sep 24, 2024
1 parent 7e492f2 commit b51deb4
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions .github/workflows/kubectl-shell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,23 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: "set image tag for pull request"
run: |
echo "IMAGE_TAG=pr${{ github.event.pull_request.number }}" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}

- name: "set image tag for develop"
run: |
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
if: ${{ github.event_name == 'push' }}
- name: "[metadata] generate image tags"
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_HUB_REPO }}
tags: |
type=ref,event=branch,pattern=develop,format=develop
type=ref,event=pull_request,format=pr{{ event.number }}
- name: "build and push images"
uses: docker/build-push-action@v6.7.0
with:
context: kubectl-shell/
tags: ${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}
build-args: |
KUBERNETES_RELEASE=v1.31.0
ALPINE=alpine:latest
HELM_VERSION=v3.15.4
KUBERNETES_RELEASE=v1.31.0
platforms: |
linux/amd64
linux/arm64
Expand All @@ -70,16 +68,3 @@ jobs:
sbom: true
provenance: true
push: true

- name: "docker scout scan"
id: docker-scout
if: ${{ github.event_name == 'pull_request' }}
uses: docker/scout-action@v1
with:
command: cves
image: ${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}
to: portainer/base:latest
ignore-unchanged: true
only-severities: critical,high
write-comment: true
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b51deb4

Please sign in to comment.