Skip to content

Commit ce29008

Browse files
committed
Add additional fetch refs to input settings
1 parent 4588309 commit ce29008

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.github/actions/checkout/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ inputs:
1515
history leading to the specified ref is fetched. When false, the full history
1616
is fetched.
1717
default: "false"
18+
additional-fetch-refs:
19+
description: >
20+
Additional refs to fetch. Each ref should be separated with new lines.
21+
For example, to fetch all tags: `refs/tags/*:refs/tags/*`
22+
default: ""
1823
token:
1924
description: >
2025
Personal access token (PAT) used to fetch the repository. The PAT is configured

.github/actions/checkout/src/git-source-settings.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export interface IGitSourceSettings {
2929
*/
3030
singleBranch: boolean
3131

32+
/**
33+
* Additional fetch refs
34+
*/
35+
additionalFetchRefs: string[]
36+
3237
/**
3338
* Indicates whether to clean the repository
3439
*/

.github/actions/checkout/src/input-helper.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ export async function getInputs(): Promise<IGitSourceSettings> {
8383
(core.getInput('single-branch') || 'false').toUpperCase() === 'TRUE'
8484
core.debug(`single branch = ${result.singleBranch}`)
8585

86+
// Additional fetch refs
87+
const additionalFetchRefsInput = core.getMultilineInput(
88+
'additional-fetch-refs'
89+
)
90+
if (additionalFetchRefsInput.length > 0) {
91+
result.additionalFetchRefs = additionalFetchRefsInput
92+
}
93+
core.debug(
94+
`additional fetch refs = ${JSON.stringify(result.additionalFetchRefs)}`
95+
)
96+
8697
// Clean
8798
result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE'
8899
core.debug(`clean = ${result.clean}`)

0 commit comments

Comments
 (0)