From 104c262d85bc523c985e575544df5fe9fcdb28a2 Mon Sep 17 00:00:00 2001 From: "maximilian.schubert@telekom.de" Date: Fri, 31 Jan 2025 19:12:58 +0100 Subject: [PATCH 1/2] ci: user lowercase org to be able to push to registry --- .github/workflows/ci.yml | 8 ++++++-- .github/workflows/release.yml | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 232ca05..1dbc35b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ jobs: id: version run: echo "value=commit-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Github org lowercase + id: org + run: "value=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -33,12 +37,12 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - ghcr.io/${{ github.repository }}:${{ steps.version.outputs.value }} + ghcr.io/${{ steps.org.outputs.value }}:${{ steps.version.outputs.value }} - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - image-ref: "ghcr.io/${{ github.repository }}:${{ steps.version.outputs.value }}" + image-ref: "ghcr.io/${{ steps.org.outputs.value }}:${{ steps.version.outputs.value }}" format: "sarif" output: "trivy-results.sarif" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6523bd..e8d2974 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,10 @@ jobs: docker: runs-on: ubuntu-latest steps: + - name: Github org lowercase + id: org + run: "value=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -29,5 +33,5 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - ghcr.io/${{ github.repository }}:${{ github.ref_name }} + ghcr.io/${{ steps.org.outputs.value }}:${{ github.ref_name }} \ No newline at end of file From 104d6d773da81d1f2d4955f4a216ecd34ef9face Mon Sep 17 00:00:00 2001 From: "maximilian.schubert@telekom.de" Date: Fri, 31 Jan 2025 19:18:15 +0100 Subject: [PATCH 2/2] ci: fix echo --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dbc35b..ecb035c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Github org lowercase id: org - run: "value=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + run: echo "value=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry uses: docker/login-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8d2974..5696e6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Github org lowercase id: org - run: "value=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + run: echo "value=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry uses: docker/login-action@v3