Navigation Menu

Skip to content

CI: Get the repository and branch name being built #25108

Answered by managedkaos
reikdas asked this question in Actions
Discussion options

You must be logged in to vote

Hello, @reikdas!  Please consider this document from the official GitHub Actions documenation:

Using environment variables

It lists all the environment variables that are automatically created in the Workflow environment.

Among the variables are:

GITHUB_REPOSITORY The owner and repository name. For example, octocat/Hello-World.

and 

GITHUB_REF The branch or tag ref that triggered the workflow. For example, refs/heads/feature-branch-1. If neither a branch or tag is available for the event type, the variable will not exist.

Those should cover the cases you need.

Please update the discussion to let readers know how you fared with this information.

Best,

ManagedKaos

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants