Use github.head_ref as branch default value#75
Merged
stefanzweifel merged 1 commit intomasterfrom May 10, 2020
Merged
Conversation
Contributor
|
I can not think of a scenario where the default Sane defaults generally make things easier to use and are also a great way to smooth over potential upgrades or breakages. It saves every user the trouble of considering possible configuration values. |
Owner
Author
|
Yeah, I think this is the way to go. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
${{ github.head_ref }}is only filled when a workflow listens to thepull_requestevent. However, it evaluates to an empty string when listening to other events (the same default value as the current version has).By doing this change, the
branch-input no longer must manually added to a workflow when listening topull_request. But, theactions/checkoutstep still has to be updated andrefhas to be added. Otherwise, the repo would be cloned in a detached head and this Action can't commit and push correctlyrefs #73
I'm not sure yet, if this is the right approach.
Actions are basically just configuration code. I think being more explicit in that configuration code leads to less confusion and easier to understand workflows.
In addition, the user still needs to update the
checkout-step. So a consumer can't just add 2-3 lines of code to add one single step. They have to update the rest of their workflow too. 🤔