Skip to content

Commit 5f47137

Browse files
authored
Fix docs about component installation for system-provided (#615)
Closes #610
1 parent 62d4898 commit 5f47137

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ jobs:
5555
- `skip_install`: (Optional) Skip the `gcloud` installation and use the
5656
[system-installed gcloud][github-runners] instead. This can dramatically
5757
improve workflow speeds at the expense of a slightly older gcloud version.
58-
Setting this to `true` ignores any value for the `version` input. Even if
59-
installation is skipped, this GitHub Action will still configure any
60-
components or project metadata. The default value is `false`.
58+
Setting this to `true` ignores any value for the `version` input. If you
59+
skip installation, you will be unable to install components because the
60+
system-install gcloud is locked. The default value is `false`.
6161

6262
- `version`: (Optional) A string representing the version or version
6363
constraint of the Cloud SDK (`gcloud`) to install (e.g. `"290.0.1"` or `">=

src/main.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,27 @@ export async function run(): Promise<void> {
5151

5252
try {
5353
const skipInstall = parseBoolean(core.getInput('skip_install'));
54+
let version = presence(core.getInput('version'));
55+
const components = core.getInput('install_components');
56+
const projectId = core.getInput('project_id');
57+
5458
if (skipInstall) {
5559
core.info(`Skipping installation ("skip_install" was true)`);
60+
if (version) {
61+
core.warning(`Ignoring "version" because "skip_install" was true!`);
62+
}
63+
64+
if (components) {
65+
core.warning(
66+
`Installing custom components with the system-provided gcloud may fail. ` +
67+
`Set "skip_install" to false to install a managed version.`,
68+
);
69+
}
5670
} else {
5771
// Compute the version information. If the version was not specified,
5872
// accept any installed version. If the version was specified as "latest",
5973
// compute the latest version. Otherwise, accept the version/version
6074
// constraint as-is.
61-
let version = presence(core.getInput('version'));
6275
if (!version) {
6376
core.debug(`version was unset, defaulting to any version`);
6477
version = '> 0.0.0';
@@ -80,7 +93,6 @@ export async function run(): Promise<void> {
8093
}
8194

8295
// Install additional components
83-
const components = core.getInput('install_components');
8496
if (components) {
8597
await installComponent(components.split(',').map((comp) => comp.trim()));
8698
}
@@ -97,7 +109,6 @@ export async function run(): Promise<void> {
97109
}
98110

99111
// Set the project ID, if given.
100-
const projectId = core.getInput('project_id');
101112
if (projectId) {
102113
await setProject(projectId);
103114
core.info('Successfully set default project');

0 commit comments

Comments
 (0)