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

Update deps and switch to autodoc #690

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
93 changes: 48 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,61 +56,64 @@ jobs:

## Inputs

### Cloud SDK inputs

- `skip_install`: (Optional) Skip the `gcloud` installation and use the
[system-installed gcloud][github-runners] instead. This can dramatically
improve workflow speeds at the expense of a slightly older gcloud version.
Setting this to `true` ignores any value for the `version` input. If you
skip installation, you will be unable to install components because the
system-install gcloud is locked. The default value is `false`. ⚠️ Be aware
that GitHub [plans to remove](https://github.com/actions/runner-images/issues/7101)
the system-installed gcloud, and any workflows with `skip_install: true`
will stop working when that happens.

- `version`: (Optional) A string representing the version or version
constraint of the Cloud SDK (`gcloud`) to install (e.g. `"290.0.1"` or `">=
197.0.1"`). The default value is `"latest"`, which will always download and
install the latest available Cloud SDK version.

```yaml
- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 416.0.0'
```
<!-- BEGIN_AUTOGEN_INPUTS -->

- <a name="version"></a><a href="#user-content-version"><code>version</code></a>: _(Optional, default: `latest`)_ A string representing the version or version constraint of the Cloud SDK
(`gcloud`) to install (e.g. `"290.0.1"` or `">= 197.0.1"`). The default
value is `"latest"`, which will always download and install the latest
available Cloud SDK version.

If there is no installed `gcloud` version that matches the given constraint,
this GitHub Action will download and install the latest available version
that still matches the constraint.
- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 416.0.0'

**Warning!** Workload Identity Federation requires version
If there is no installed `gcloud` version that matches the given
constraint, this GitHub Action will download and install the latest
available version that still matches the constraint.

Authenticating via Workload Identity Federation requires version
[363.0.0](https://cloud.google.com/sdk/docs/release-notes#36300_2021-11-02)
or newer. If you need support for Workload Identity Federation, specify your
version constraint as such:
or newer. If you need support for Workload Identity Federation, specify
your version constraint as such:

```yaml
- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
```
- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

You are responsible for ensuring the `gcloud` version matches the features
and components required. See the [gcloud release
notes][gcloud-release-notes] for a full list of versions.
and components required.

- `project_id`: (Optional) Project ID (**not** project _number_) of the Google
Cloud project. If provided, this will configure the `gcloud` CLI to use that
project ID for commands. Individual commands can still override the project
with the `--project` flag. If unspecified, the action attempts to find the
"best" project ID by looking at other inputs and environment variables.
- <a name="project_id"></a><a href="#user-content-project_id"><code>project_id</code></a>: _(Optional)_ ID of the Google Cloud project. If provided, this will configure gcloud to
use this project ID by default for commands. Individual commands can still
override the project using the `--project` flag which takes precedence. If
unspecified, the action attempts to find the "best" project ID by looking
at other inputs and environment variables.

- `install_components`: (Optional) List of [Cloud SDK
components](https://cloud.google.com/sdk/docs/components) to install
- <a name="install_components"></a><a href="#user-content-install_components"><code>install_components</code></a>: _(Optional)_ List of additional [gcloud
components](https://cloud.google.com/sdk/docs/components) to install,
specified as a comma-separated list of strings:

```yaml
install_components: 'alpha,cloud-datastore-emulator'
```
install_components: 'alpha,cloud-datastore-emulator'

- <a name="skip_install"></a><a href="#user-content-skip_install"><code>skip_install</code></a>: _(Optional)_ Skip installation of gcloud and use the [system-supplied
version](https://github.com/actions/runner-images) instead. If specified,
the `version` input is ignored.

⚠️ You will not be able to install additional gcloud components, because the
system installation is locked.


<!-- END_AUTOGEN_INPUTS -->

## Outputs

<!-- BEGIN_AUTOGEN_OUTPUTS -->

- `version`: Version of gcloud that was installed.


<!-- END_AUTOGEN_OUTPUTS -->


## Authorization

Expand Down
63 changes: 49 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,69 @@ description: |-
Adds the `gcloud` CLI command to the $PATH.

inputs:
skip_install:
description: |-
Skip installation of the gcloud SDK and use the system-supplied version
instead. The "version" input will be ignored.
default: false
required: false

version:
description: |-
Version or version constraint of the gcloud SDK to install. If
unspecified, it will accept any installed version of the gcloud SDK. If
set to "latest", it will download the latest available SDK. If set to a
version constraint, it will download the latest available version that
matches the constraint. Examples: "290.0.1" or ">= 197.0.1".
A string representing the version or version constraint of the Cloud SDK
(`gcloud`) to install (e.g. `"290.0.1"` or `">= 197.0.1"`). The default
value is `"latest"`, which will always download and install the latest
available Cloud SDK version.

- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 416.0.0'

If there is no installed `gcloud` version that matches the given
constraint, this GitHub Action will download and install the latest
available version that still matches the constraint.

Authenticating via Workload Identity Federation requires version
[363.0.0](https://cloud.google.com/sdk/docs/release-notes#36300_2021-11-02)
or newer. If you need support for Workload Identity Federation, specify
your version constraint as such:

- uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

You are responsible for ensuring the `gcloud` version matches the features
and components required.
default: 'latest'
required: false

project_id:
description: |-
ID of the Google Cloud project. If provided, this will configure gcloud to
use this project ID by default for commands. Individual commands can still
override the project using the --project flag which takes precedence.
override the project using the `--project` flag which takes precedence. If
unspecified, the action attempts to find the "best" project ID by looking
at other inputs and environment variables.
required: false

install_components:
description: List of Cloud SDK components to install
description: |-
List of additional [gcloud
components](https://cloud.google.com/sdk/docs/components) to install,
specified as a comma-separated list of strings:

install_components: 'alpha,cloud-datastore-emulator'
required: false

skip_install:
description: |-
Skip installation of gcloud and use the [system-supplied
version](https://github.com/actions/runner-images) instead. If specified,
the `version` input is ignored.

⚠️ You will not be able to install additional gcloud components, because the
system installation is locked.
default: false
required: false

outputs:
version:
description: |-
Version of gcloud that was installed.

branding:
icon: 'terminal'
color: 'blue'
Expand Down
Loading
Loading