-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default branch reference in GitHub Actions workflow definitions #278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! For others: see also this.
Suggested commit message:
Fix default branch reference in GitHub Actions workflow definitions (#278)
.github/workflows/build.yaml
Outdated
branches: | ||
- master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could still do:
branches: | |
- master | |
branches: [ master ] |
(Assuming the earlier intention was to match jdk: [ 11.0.16, 17.0.4 ]
below. Or we could change both to multi-line lists. Maybe that's nicer?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the jdk
field is a bit different as for matrix
that is the way to define the values, see here.
AFAICS that is the only way there. For branches, especially if it is only one, I prefer the - master
way.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs also use both approaches, not very consistent. [something]
is the same as - something
, so in the end shouldn't matter. It can be a shorthand, which are especially helpful for matrices, whereas branches are longer to begin with.
jdk: [ 11.0.16, 17.0.4 ]
instead of
jdk:
- 11.0.16
- 17.0.4
Nevertheless, I don't see us expanding this list to a wide range, so using the shorthand is pretty clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One answer/question.
Already approving as it is not a blocker.
.github/workflows/build.yaml
Outdated
branches: | ||
- master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the jdk
field is a bit different as for matrix
that is the way to define the values, see here.
AFAICS that is the only way there. For branches, especially if it is only one, I prefer the - master
way.
WDYT?
Okay clear, let's merge when the build is green 😄. |
In #253 the GHA workflow was edited to use
$default-branch
. Whilst this works in workflow templates, this actually doesn't in a workflow.Here, we revert to referencing
master
directly.