Skip to content

Commit f80ec2b

Browse files
authored
docs: make it clearer that most auth inputs are deprecated (#459)
1 parent 0f2d46d commit f80ec2b

1 file changed

Lines changed: 51 additions & 28 deletions

File tree

README.md

Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
1-
<!--
2-
Copyright 2019 Google LLC
3-
4-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5-
compliance with the License. You may obtain a copy of the License at
6-
7-
https://www.apache.org/licenses/LICENSE-2.0
8-
9-
Unless required by applicable law or agreed to in writing, software distributed under the License
10-
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11-
implied. See the License for the specific language governing permissions and limitations under the
12-
License.
13-
-->
14-
151
# `setup-gcloud` GitHub Action
162

173
Configures the [Google Cloud SDK][sdk] in the GitHub Actions environment. The Google Cloud SDK includes both the [gcloud][gcloud] and
184
[gsutil][gsutil] binaries.
195

206
Or integrate natively with other Google Cloud GitHub Actions:
217

22-
* [Authenticate to Google Cloud](https://github.com/google-github-actions/auth)
8+
* [Authenticate to Google Cloud][auth]
239
* [Deploy a Cloud Run service](https://github.com/google-github-actions/deploy-cloudrun)
2410
* [Deploy an App Engine app](https://github.com/google-github-actions/deploy-appengine)
2511
* [Deploy a Cloud Function](https://github.com/google-github-actions/deploy-cloud-functions)
@@ -33,7 +19,7 @@ Or integrate natively with other Google Cloud GitHub Actions:
3319
rename the branch to `main` in 2022 and this _will break_ existing
3420
workflows. See [Versioning](#versioning) for more information.**
3521

36-
- **Previously this repository contained the code for ALL of the GCP GithHub
22+
- **Previously this repository contained the code for ALL of the GCP GitHub
3723
Actions. Now each action has it's own repo and this repo is only for
3824
`setup-gcloud`.**
3925

@@ -81,18 +67,52 @@ jobs:
8167

8268
## Inputs
8369

84-
| Name | Requirement | Default | Description |
85-
| ------------- | ----------- | ------- | ----------- |
86-
| `version` | _optional_ | `latest`| The version of the `gcloud` to be installed. Example: `290.0.1`|
87-
| `project_id` | _optional_ | | ID of the Google Cloud Platform 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. |
88-
| `service_account_email` | _optional_ | | Service account email address to use for authentication. This is required for legacy .p12 keys but can be omitted for JSON keys. This is usually of the format `<name>@<project-id>.iam.gserviceaccount.com`. |
89-
| `export_default_credentials`| _optional_ |`false`| Exports the path to [Default Application Credentials][dac] as the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to be available in later steps. Google Cloud services automatically use this environment variable to find credentials. |
90-
| `credentials_file_path` | _optional_ | (temporary file) | Only valid when `export_default_credentials` is `true`. Sets the path at which the credentials should be written. |
91-
| `cleanup_credentials` | _optional_ | `true` | If true, the action will remove exported credentials from the filesystem upon completion. This only applies if `export_default_credentials` is true. |
92-
| `service_account_key` | _optional_ | | (**Deprecated**) This input is deprecated. See [auth section](https://github.com/google-github-actions/setup-gcloud#authorization) for more details. The service account key which will be used for authentication credentials. This key should be [created](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) and stored as a [secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets). It can be encoded as a [Base64](https://en.wikipedia.org/wiki/Base64) string or as JSON. |
70+
### Cloud SDK inputs
71+
72+
- `version`: (Optional) A string representing the version of the Cloud SDK
73+
(`gcloud`) to install (e.g. `"290.0.1"`). The default value is "latest",
74+
which will install the latest available Cloud SDK version.
75+
76+
- `project_id`: (Optional) Project ID (**not** project _number_) of the Google
77+
Cloud project. If provided, this will configure the `gcloud` CLI to use that
78+
project ID for commands. Individual commands can still override the project
79+
with the `--project` flag. If unspecified, the action attempts to find the
80+
"best" project ID by looking at other inputs and environment variables.
81+
82+
### Authentication inputs
83+
84+
**⚠️ Deprecated**: The following authentication inputs are deprecated and will
85+
be removed in a future release. See [Authorization](#authorization) for more
86+
information.
87+
88+
- `service_account_key`: (**Deprecated**, optional) The Google Cloud service
89+
account key JSON. This key should be created and stored as a GitHub secret.
90+
It can be the raw JSON contents or a base64-encoded string of the raw JSON
91+
contents. There is no default value.
92+
93+
- `service_account_email`: (**Deprecated**, optional) Email address of the
94+
service account to use for authentication. This is only required for p12
95+
service account keys, which are no longer recommended. This input is not
96+
required if using a JSON service account key. There is no default value.
97+
98+
- `export_default_credentials`: (**Deprecated**, optional) If true, the action
99+
will write credentials to the filesystem and export the
100+
`GOOGLE_APPLICATION_CREDENTIALS` environment variable for future steps to
101+
consume [Application Default Credentials][adc]. The default value is false.
102+
103+
- `credentials_file_path`: (**Deprecated**, optional) The path at which the
104+
exported credentials should be written on disk. In order for the credentials
105+
to be available for future steps, it must be in `$GITHUB_WORKSPACE` or
106+
`$RUNNER_TEMP`. This is only valid when `export_default_credentials` is
107+
true. The default value is a temporary file inside `$GITHUB_WORKSPACE`.
108+
109+
- `cleanup_credentials`: (**Deprecated**, optional) If true, the action will
110+
remove any generated credentials from the filesystem after all steps have
111+
completed. This only applies if `export_default_credentials` is true. The
112+
default value is true.
93113

94114

95-
## Example Workflows
115+
## Example workflows
96116

97117
* [Google Kubernetes Engine](./example-workflows/gke/README.md): An example workflow that uses GitHub Actions to deploy a static website to an existing [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) cluster.
98118

@@ -108,7 +128,9 @@ code to [App Engine](https://cloud.google.com/appengine), a fully managed server
108128

109129
## Authorization
110130

111-
This action installs the Cloud SDK (`gcloud`). To configure its authentication to Google Cloud, use the [google-github-actions/auth](https://github.com/google-github-actions/auth) action. You can authenticate via:
131+
This action installs the Cloud SDK (`gcloud`). To configure its authentication
132+
to Google Cloud, use the [google-github-actions/auth][auth] action. You can
133+
authenticate via:
112134

113135
### Workload Identity Federation (preferred)
114136

@@ -201,7 +223,8 @@ See [LICENSE](LICENSE).
201223

202224

203225
[github-action]:https://help.github.com/en/categories/automating-your-workflow-with-github-actions
204-
[dac]: https://cloud.google.com/docs/authentication/production
226+
[auth]: https://github.com/google-github-actions/auth
227+
[adc]: https://cloud.google.com/docs/authentication/production
205228
[sdk]: https://cloud.google.com/sdk/
206229
[gcloud]: https://cloud.google.com/sdk/gcloud/
207230
[gsutil]: https://cloud.google.com/storage/docs/gsutil

0 commit comments

Comments
 (0)