Skip to content

Commit f989621

Browse files
authored
Fix ADC documentation, issue#685 (#686)
<!-- Thank you for proposing a pull request! Please note that SOME TESTS WILL LIKELY FAIL due to how GitHub exposes secrets in Pull Requests from forks. Someone from the team will review your Pull Request and respond. Please describe your change and any implementation details below. --> Fixes to readme for inaccurate guidance on setting Application Default Credentials. #685 --------- Signed-off-by: eeaton <[email protected]>
1 parent 87fba63 commit f989621

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ jobs:
114114

115115
## Authorization
116116

117-
This action installs the Cloud SDK (`gcloud`). To configure its authentication
118-
to Google Cloud, use the [google-github-actions/auth][auth] action. You can
119-
authenticate via:
117+
The `setup-gcloud` action installs the Cloud SDK (`gcloud`). To configure its authentication
118+
to Google Cloud, you must first use the [google-github-actions/auth][auth] action. The `auth`
119+
action sets [Application Default Credentials][adc], then the `setup-gcloud` action references
120+
these credentials to configure [gcloud credentials][gcloud-credentials] . You can
121+
authenticate via the following options:
120122

121123
### Workload Identity Federation (preferred)
122124

@@ -163,10 +165,11 @@ jobs:
163165
run: 'gcloud info'
164166
```
165167

166-
### Application Default Credentials
168+
### Self-hosted runners on Google Cloud Platform
167169

168-
If and only if you are using self-hosted runners that are hosted on Google Cloud Platform,
169-
the Cloud SDK will automatically authenticate using the machine credentials:
170+
If you are using self-hosted runners that are hosted on Google Cloud Platform, credentials
171+
are automatically obtained from the service account attached to the runner.
172+
In this scenario, you do not need to run the [google-github-actions/auth][auth] action.
170173

171174
```yaml
172175
jobs:
@@ -243,9 +246,10 @@ explicitly updating your version number. Note that we only publish `MAJOR` and
243246

244247
[github-action]:https://help.github.com/en/categories/automating-your-workflow-with-github-actions
245248
[auth]: https://github.com/google-github-actions/auth
246-
[adc]: https://cloud.google.com/docs/authentication/production
249+
[adc]: https://cloud.google.com/docs/authentication/application-default-credentials
247250
[sdk]: https://cloud.google.com/sdk/
248251
[gcloud]: https://cloud.google.com/sdk/gcloud/
252+
[gcloud-credentials]: https://cloud.google.com/docs/authentication/gcloud#gcloud-credentials
249253
[gsutil]: https://cloud.google.com/storage/docs/gsutil
250254
[sa-iam-docs]: https://cloud.google.com/iam/docs/service-accounts
251255
[sa]: https://cloud.google.com/iam/docs/creating-managing-service-accounts

0 commit comments

Comments
 (0)