Skip to content

How to get base ref branch in a GitHub Actions workflow? #26243

Answered by airtower-luna
merc1er asked this question in Actions
Discussion options

You must be logged in to vote
merc1er:

Is there a way to know the base ref on every push to dev?

No, because a push doesn’t have a “base ref”, just a before and after state on the branch that’s being pushed.

If you want to act based on a PR you need to use one of the PR-related events (or iterate over PRs using the API, but that could get messy and run afoul of rate limits).

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@thalysonalexr
Comment options

@airtower-luna
Comment options

@jsoref
Comment options

@thalysonalexr
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Product Feedback
5 participants