Skip to content
Latchkey

What Is GITHUB_REPOSITORY?

GITHUB_REPOSITORY is the owner/repo identifier of the repository running the workflow.

GITHUB_REPOSITORY is handy for building image names, calling the GitHub API, or constructing URLs that reference the current repo.

Common uses

  • Name a container image: ghcr.io/$GITHUB_REPOSITORY
  • Build API URLs
  • Split owner and repo with parameter expansion

Example

Push to the GitHub Container Registry path for this repo.

shell
docker push ghcr.io/${GITHUB_REPOSITORY}:latest

Key takeaways

  • GITHUB_REPOSITORY is owner/repo.
  • Great for image names and API URLs.
  • GITHUB_REPOSITORY_OWNER gives just the owner.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →