Skip to content

mixed case organizations fail (ex: PromptExecution) #243

Open
@elasticdotventures

Description

@elasticdotventures

The problem

build-and-push
buildx failed with: ERROR: invalid tag "ghcr.io/PromptExecution/ebook-convert:v0.0.1": repository name must be lowercase

The solution:

name: Docker

on:
  push:
    branches: [ "master" ]
    tags: [ 'v*.*.*' ]
  pull_request:
    branches: [ "master" ]

env:
  REGISTRY: ghcr.io

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      # Additional step to set lowercase image name
      - name: Set lowercase image name
        id: set_lowercase_name
        run: echo "IMAGE_NAME_LOWER=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

      # ....

      # Modify this step to use the lowercase image name
      - name: Extract Docker metadata
        id: meta
        uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}

      # Continue with the remaining steps...

Let me know if this is acceptable resolution and I'll send up a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions