Open
Description
Problem
Currently, when using actions/checkout
, specifying a ref
that does not exist causes the action to fail. In some workflows, it would be more efficient if, when the specified branch does not exist, a new branch could be automatically created from the default branch.
Proposed Solution
I propose adding an auto-create
option to actions/checkout
. This option would allow the action to:
- Checkout the default branch (e.g.,
main
) if the specifiedref
does not exist. - Create a new branch with the specified
ref
from the default branch.
This behavior would only occur when the auto-create
option is enabled, keeping the current behavior unchanged by default.
Example YAML
- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'feature-branch'
auto-create: true
Metadata
Metadata
Assignees
Labels
No labels