Skip to content

Commit

Permalink
Add support for universes and regional secrets (#301)
Browse files Browse the repository at this point in the history
This adds support for regional secrets, but it's intentionally
undocumented. It also adds support for universes, which is documented.

Closes
#300

---------

Co-authored-by: abheda-crest <alfatah.bheda@crestdata.ai>
  • Loading branch information
sethvargo and abheda-crest authored Oct 24, 2024
1 parent 95a0b09 commit 61d5d10
Show file tree
Hide file tree
Showing 12 changed files with 422 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
version_strategy: '${{ github.event.inputs.version_strategy }}'
# secrets must be explicitly passed to reusable workflows https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow
secrets:
ACTIONS_BOT_TOKEN: '${{ secrets.ACTIONS_BOT_TOKEN }}'
ACTIONS_BOT_TOKEN: '${{ secrets.ACTIONS_BOT_TOKEN }}'
6 changes: 4 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ jobs:
secrets: |-
token:${{ vars.SECRET_NAME }}
password:${{ vars.SECRET_VERSION_NAME }}
regional:${{ vars.REGIONAL_SECRET_NAME }}
- name: 'outputs'
run: echo '${{ steps.secrets.outputs.token }}${{ steps.secrets.outputs.password }}'
run: echo '${{ steps.secrets.outputs.token }}${{ steps.secrets.outputs.password }}${{ steps.secrets.outputs.regional }}'

- id: 'secrets-encoded'
name: 'secrets-encoded'
Expand All @@ -56,6 +57,7 @@ jobs:
secrets: |-
token:${{ vars.SECRET_NAME }}
password:${{ vars.SECRET_VERSION_NAME }}
regional:${{ vars.REGIONAL_SECRET_NAME }}
- name: 'outputs-encoded'
run: echo '${{ steps.secrets-encoded.outputs.token }}${{ steps.secrets-encoded.outputs.password }}'
run: echo '${{ steps.secrets-encoded.outputs.token }}${{ steps.secrets-encoded.outputs.password }}${{ steps.secrets-encoded.outputs.regional }}'
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
release:
if: "startsWith(github.event.head_commit.message, 'Release: v')"
if: |-
${{ startsWith(github.event.head_commit.message, 'Release: v') }}
name: 'Release'
uses: 'google-github-actions/.github/.github/workflows/release.yml@v0'
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ jobs:
available encoding types, please see the [Node.js Buffer and character
encodings](https://nodejs.org/docs/latest/api/buffer.html#buffers-and-character-encodings).

- <a name="universe"></a><a href="#user-content-universe"><code>universe</code></a>: _(Optional, default: `googleapis.com`)_ The Google Cloud universe to use for constructing API endpoints. The
default universe is "googleapis.com", which corresponds to
https://cloud.google.com. Trusted Partner Cloud and Google Distributed
Hosted Cloud should set this to their universe address.


<!-- END_AUTOGEN_INPUTS -->

Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ inputs:
required: false
default: 'utf8'

universe:
description: |-
The Google Cloud universe to use for constructing API endpoints. The
default universe is "googleapis.com", which corresponds to
https://cloud.google.com. Trusted Partner Cloud and Google Distributed
Hosted Cloud should set this to their universe address.
required: false
default: 'googleapis.com'

outputs:
secrets:
description: |-
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 61d5d10

Please sign in to comment.