Skip to content
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

Default branch checkout option #1615

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update action.yml and readme
  • Loading branch information
alexanderkranga committed Feb 19, 2024
commit 47b938279919d0395ab4a2e3cb825383104b5471
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -29,10 +29,10 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# Otherwise, uses the default branch.
ref: ''

# Whether to checkout the default repository branch if specified ref does not
# exist. If this is set to true, then fetch-depth should be 0
# Default: true
default-ref-on-error: ''
# Indicates whether to checkout the default repository branch if the requested ref
# does not exist
# Default: false
default-branch-checkout: ''

# Personal access token (PAT) used to fetch the repository. The PAT is configured
# with the local git config, which enables your scripts to run authenticated git
8 changes: 3 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
@@ -9,11 +9,9 @@ inputs:
The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that
event. Otherwise, uses the default branch.
default-ref-on-error:
description: >
Whether to checkout the default repository branch if specified ref does not exist.
If this is set to true, then fetch-depth should be 0
default: true
default-branch-checkout:
description: 'Indicates whether to checkout the default repository branch if the requested ref does not exist'
default: false
token:
description: >
Personal access token (PAT) used to fetch the repository. The PAT is configured
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -1741,7 +1741,8 @@ function getInputs() {
core.debug(`commit = '${result.commit}'`);
// Default branch checkout
result.defaultBranchCheckout =
(core.getInput('default-branch-checkout') || 'true').toUpperCase() === 'TRUE';
(core.getInput('default-branch-checkout') || 'true').toUpperCase() ===
'TRUE';
core.debug(`default-branch-checkout = '${result.defaultBranchCheckout}'`);
// Clean
result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';