-
Notifications
You must be signed in to change notification settings - Fork 64.3k
Description
What article on docs.github.com is affected?
What part(s) of the article would you like to see updated?
The yaml example given for copy-paste in the Starting with the Node.js workflow template section uses $default-branch as the branch filter within both the push and pull-request events.
The $default-branch syntax is correct for a starter template like the Node.js starter and is automatically changed to the repository's default branch on instantiating the template.
However, copy-pasting this syntax as suggested in this section creates an incorrect workflow.
In place of $default-branch, the code for copy-paste should use main (the current default for the default branch) and perhaps indicate that users need to edit this if they have a different default branch name.
Additional information
Here is a commit showing that main syntax works but $default-branch syntax does not: steven-wolfman/test-workflow-template-syntax@0d006c5#diff-fbdccf80e37a6640cb78bdcf9d90597cb91421747fd5c2365d878287e744ff99. (Click the check-mark to see that only the workflow using standard syntax runs while, e.g., the workflow copy-pasted from the docs does not run.
You can read a discussion thread indicating that $default-branch is template-specific syntax.
Aside: If that raw YAML is somehow automatically-generated from the Node.js starter, which seems like a great idea, then this will require more care.
P.S. I'm putting this issue in as I prep a PR to correct this, but the contributing guidelines suggested starting with an issue. 😊