Skip to content

Commit

Permalink
make sha available
Browse files Browse the repository at this point in the history
  • Loading branch information
JTaeuber committed Feb 26, 2025
1 parent 0ffe8d6 commit fb3f62b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
image_digest: ${{ steps.build-push.outputs.digest }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -85,4 +87,6 @@ jobs:
call-e2e:
needs: build
uses: ./.github/workflows/end2end.yml
with:
image_digest: ${{ needs.build.outputs.image_digest }}
secrets: inherit
19 changes: 5 additions & 14 deletions .github/workflows/prune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Prune GHCR

on:
workflow_call:
inputs:
image_digest:
required: true
type: string

permissions:
contents: write
Expand All @@ -14,19 +18,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: install crane
run: |
VERSION=$(curl -s "https://api.github.com/repos/google/go-containerregistry/releases/latest" | jq -r '.tag_name')
curl -sSL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_Linux_x86_64.tar.gz" | sudo tar -zxvf - -C /usr/local/bin
- name: Authenticate crane with GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | crane auth login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: get commit checksum
run: |
CHECKSUM=$(crane digest ghcr.io/caas-team/py-kube-downscaler/${GITHUB_SHA})
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV
- name: Prune Images
uses: vlaurin/[email protected]
with:
Expand All @@ -38,4 +29,4 @@ jobs:
prune-untagged: true
prune-tags-regexes: |
^commit-
${CHECKSUM}
${{ inputs.image_digest }}\.sig

0 comments on commit fb3f62b

Please sign in to comment.