Skip to content

Example for Publishing Docker images to GitHub Packages broken #7424

@bananer

Description

@bananer

What article on docs.github.com is affected?

https://docs.github.com/en/actions/guides/publishing-docker-images#publishing-images-to-github-packages

What part(s) of the article would you like to see updated?

In the example file, the tag is specified like this:

docker.pkg.github.com/${{ github.repository }}/octo-image:${{ github.ref }}

However, the variable github.ref resolved to something like refs/heads/my_branch_name (as documented).

This causes the step to fail:

error: invalid tag "docker.pkg.github.com/bananer/my-repo/mps:refs/heads/my_branch_name": invalid reference format
Error: buildx call failed with: error: invalid tag "docker.pkg.github.com/bananer/my-repo/mps:refs/heads/my_branch_name": invalid reference format

Additional information

My goal is to publish to a docker tag matching my branch name, assuming this is also the intent of the example. Seems like there is no official way to get the branch name without refs/heads/ prefix in the official docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions