Use github.head_ref as branch default value #75
Merged
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_request
event. 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/checkout
step still has to be updated andref
has 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. 🤔