How to get the current branch within Github Actions?

I’m building Docker images with Github Actions and want to tag images with the branch name.

I found the GITHUB_REF variable, but it results in refs/heads/feature-branch-1 and I need only feature-branch-1.

27 Answers
27

Leave a Comment