Skip to content

Commit

Permalink
Downsize the org:repo name (#1104)
Browse files Browse the repository at this point in the history
Currently we fail with:

`ERROR: invalid tag "ghcr.io/PyCQA/bandit/bandit:latest": repository name
must be lowercase`

This is from the capitalized org name: PyCQA

This change lowercases the entire string
  • Loading branch information
lukehinds authored Jan 23, 2024
1 parent 3f86e84 commit 4c5b3c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,23 @@ jobs:
with:
cosign-release: 'v2.2.2'

- name: Downcase github.repository value
run: |
echo "IMAGE_NAME=`echo ${{github.repository}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/bandit:latest
tags: ghcr.io/${{ env.IMAGE_NAME }}/bandit:latest
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v8

- name: Sign the image
env:
TAGS: ghcr.io/${{ github.repository }}/bandit:latest
TAGS: ghcr.io/${{ env.IMAGE_NAME }}/bandit:latest
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: |
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

0 comments on commit 4c5b3c8

Please sign in to comment.