Add an option to create a new branch from the default branch if the specified ref does not exist
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 32/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- ci-cd
Research direction
No files, tests, or entry points are named in the issue. Start by locating actions/checkout's ref-resolution flow, then verify that the proposed option preserves current failure behavior when disabled and creates the requested branch from the repository's default branch when enabled.
Written by the indexing model from the issue text.
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 specifiedrefdoes not exist. - Create a new branch with the specified
reffrom 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
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/checkout
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
All issues in actions/checkout
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·