Skip to content

Commit 95471c2

Browse files
committed
fail when submodules or ssh-key and fallback to REST API
1 parent 2a15e11 commit 95471c2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

dist/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -5825,6 +5825,12 @@ function getSource(settings) {
58255825
// Downloading using REST API
58265826
core.info(`The repository will be downloaded using the GitHub REST API`);
58275827
core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
5828+
if (settings.submodules) {
5829+
throw new Error(`Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
5830+
}
5831+
else if (settings.sshKey) {
5832+
throw new Error(`Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
5833+
}
58285834
yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
58295835
return;
58305836
}

src/git-source-provider.ts

+10
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
5757
core.info(
5858
`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`
5959
)
60+
if (settings.submodules) {
61+
throw new Error(
62+
`Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`
63+
)
64+
} else if (settings.sshKey) {
65+
throw new Error(
66+
`Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`
67+
)
68+
}
69+
6070
await githubApiHelper.downloadRepository(
6171
settings.authToken,
6272
settings.repositoryOwner,

0 commit comments

Comments
 (0)