Skip to content

Commit

Permalink
feat: Support authentication from Auth Action (#48)
Browse files Browse the repository at this point in the history
* feat: support WIF creds file

* add tests

* deps

* regen docs

* fix test

* reuse write file from auth

* prune uuid deps

* regen docs
  • Loading branch information
bharathkkb committed Nov 30, 2021
1 parent 19c3d84 commit d76bc07
Show file tree
Hide file tree
Showing 7 changed files with 486 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ npm install @google-github-actions/setup-cloud-sdk
```TS
import * as core from '@actions/core';
import * as toolCache from '@actions/tool-cache';
import * as setupGcloud from 'setup-cloud-sdk';
import * as setupGcloud from '@google-github-actions/setup-cloud-sdk';

// Install gcloud if not already installed.
const gcloudVersion = await setupGcloud.getLatestGcloudSDKVersion();
Expand Down
34 changes: 18 additions & 16 deletions docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@

### authenticateGcloudSDK

**authenticateGcloudSDK**(`serviceAccountKey`, `silent?`): `Promise`<`number`\>
**authenticateGcloudSDK**(`serviceAccountKey?`, `silent?`): `Promise`<`number`\>

Authenticates the gcloud tool using a service account key.
Authenticates the gcloud tool using a service account key or WIF credential configuration
discovered via GOOGLE_GHA_CREDS_PATH environment variable. An optional serviceAccountKey
param is supported for legacy Actions.

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `serviceAccountKey` | `string` | `undefined` | The service account key used for authentication. |
| `silent` | `boolean` | `true` | - |
| `serviceAccountKey?` | `string` | `undefined` | The service account key used for authentication. |
| `silent` | `boolean` | `true` | Skip writing output to sdout. |

#### Returns

Expand All @@ -42,7 +44,7 @@ exit code.

#### Defined in

[index.ts:182](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L182)
[index.ts:201](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L201)

___

Expand All @@ -58,7 +60,7 @@ The latest stable version of the gcloud SDK.

#### Defined in

[version-util.ts:27](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/version-util.ts#L27)
[version-util.ts:27](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/version-util.ts#L27)

___

Expand All @@ -76,7 +78,7 @@ gcloud command.

#### Defined in

[index.ts:49](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L49)
[index.ts:50](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L50)

___

Expand All @@ -101,7 +103,7 @@ CMD output

#### Defined in

[index.ts:250](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L250)
[index.ts:321](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L321)

___

Expand All @@ -125,7 +127,7 @@ The path of the installed tool.

#### Defined in

[index.ts:119](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L119)
[index.ts:120](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L120)

___

Expand All @@ -149,7 +151,7 @@ true is gcloud is authenticated.

#### Defined in

[index.ts:91](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L91)
[index.ts:92](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L92)

___

Expand All @@ -173,7 +175,7 @@ true if gcloud is found in toolpath.

#### Defined in

[index.ts:34](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L34)
[index.ts:35](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L35)

___

Expand All @@ -197,7 +199,7 @@ true is project Id is set.

#### Defined in

[index.ts:64](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L64)
[index.ts:65](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L65)

___

Expand All @@ -221,7 +223,7 @@ ServiceAccountKey as an object.

#### Defined in

[index.ts:141](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L141)
[index.ts:142](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L142)

___

Expand All @@ -246,7 +248,7 @@ CMD output

#### Defined in

[index.ts:279](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L279)
[index.ts:350](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L350)

___

Expand All @@ -271,7 +273,7 @@ project ID.

#### Defined in

[index.ts:215](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L215)
[index.ts:286](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L286)

___

Expand All @@ -295,4 +297,4 @@ project ID.

#### Defined in

[index.ts:236](https://github.com/google-github-actions/setup-cloud-sdk/blob/3de11b9/src/index.ts#L236)
[index.ts:307](https://github.com/google-github-actions/setup-cloud-sdk/blob/ed4039f/src/index.ts#L307)
Loading

0 comments on commit d76bc07

Please sign in to comment.