Compare commits

...

6 commits
v2 ... main

Author SHA1 Message Date
gurusai-voleti
01af06c41d
chore: Migrate gsutil usage to gcloud storage (#733)
Automated: Migrate {target_path} from gsutil to gcloud storage

This CL is part of the on going effort to migrate from the legacy
`gsutil` tool to the new and improved `gcloud storage` command-line
interface.
`gcloud storage` is the recommended and modern tool for interacting with
Google Cloud Storage, offering better performance, unified
authentication, and a more consistent command structure with other
`gcloud` components. 🚀

### Automation Details

This change was **generated automatically** by an agent that targets
users of `gsutil`.
The transformations applied are based on the [gsutil to gcloud storage
migration guide](http://go/gsutil-gcloud-storage-migration-guide).

### ⚠️ Action Required: Please Review and Test Carefully

While we have based the automation on the migration guide, every use
case is unique.
**It is crucial that you thoroughly test these changes in environments
appropriate to your use-case before merging.**
Be aware of potential differences between `gsutil` and `gcloud storage`
that could impact your workflows.
For instance, the structure of command output may have changed,
requiring updates to any scripts that parse it. Similarly, command
behavior can differ subtly; the `gcloud storage rsync` command has a
different file deletion logic than `gsutil rsync`, which could lead to
unintended file deletions.

Our migration guides can help guide you through a list of mappings and
some notable differences between the two tools.

Standard presubmit tests are run as part of this CL's workflow. **If you
need to target an additional test workflow or require assistance with
testing, please let us know.**

Please verify that all your Cloud Storage operations continue to work as
expected to avoid any potential disruptions in production.

### Support and Collaboration

The `GCS CLI` team is here to help! If you encounter any issues, have a
complex use case that this automated change doesn't cover, or face any
other blockers, please don't hesitate to reach out.
We are happy to work with you to test and adjust these changes as
needed.

**Contact:** `gcs-cli-hyd@google.com`

We appreciate your partnership in this important migration effort!

#gsutil-migration

Signed-off-by: gurusai-voleti <gvoleti@google.com>
2026-04-07 15:12:47 -04:00
Google GitHub Actions Bot
aa5489c893
Release: v3.0.1 (#729)
**Full Changelog**:
https://github.com/google-github-actions/setup-gcloud/compare/v3.0.0...v3.0.1

This is a noop change to trigger the update of the `@v3` tag.
2025-08-28 13:37:35 +00:00
Google GitHub Actions Bot
26f734c277
Release: v3.0.0 (#726)
## What's Changed
- **‼️ This release requires Node 24+!**
- **‼️ The `skip_tool_cache` option has been removed!** Skipping the
tool cache is now the default behavior. To restore the previous behavior
of using the tool cache (which is unnecessary on GitHub managed runners,
but may provide performance increases on self-hosted runners), set
`cache: true`.
---
* Bump to node24 by @sethvargo in
https://github.com/google-github-actions/setup-gcloud/pull/723
* Do not use the tool-cache by default by @sethvargo in
https://github.com/google-github-actions/setup-gcloud/pull/724
* Update to use v3 references by @sethvargo in
https://github.com/google-github-actions/setup-gcloud/pull/725


**Full Changelog**:
https://github.com/google-github-actions/setup-gcloud/compare/v2.2.1...v3.0.0
2025-08-25 01:58:24 +00:00
Seth Vargo
d26df95ce1
Update to use v3 references (#725) 2025-08-24 21:54:52 -04:00
Seth Vargo
f7c29183d6
Do not use the tool-cache by default (#724) 2025-08-24 21:51:10 -04:00
Seth Vargo
6387e69544
Bump to node24 (#723) 2025-08-24 21:47:21 -04:00
8 changed files with 67 additions and 64 deletions

5
.github/actionlint.yml vendored Normal file
View file

@ -0,0 +1,5 @@
paths:
'**/*.yml':
ignore:
# https://github.com/rhysd/actionlint/issues/559
- 'invalid runner name "node24"'

View file

@ -46,28 +46,24 @@ jobs:
uses: './' uses: './'
with: with:
skip_install: true skip_install: true
skip_tool_cache: true
# Constraint installation # Constraint installation
- name: 'Install constraint' - name: 'Install constraint'
uses: './' uses: './'
with: with:
version: '>= 1.0.0' version: '>= 1.0.0'
skip_tool_cache: true
# Default installation # Default installation
- name: 'Install version' - name: 'Install version'
uses: './' uses: './'
with: with:
version: '374.0.0' version: '374.0.0'
skip_tool_cache: true
# Latest installation # Latest installation
- name: 'Install latest' - name: 'Install latest'
uses: './' uses: './'
with: with:
version: 'latest' version: 'latest'
skip_tool_cache: true
# By default, there is no configuration # By default, there is no configuration
- name: 'Check defaults' - name: 'Check defaults'
@ -81,7 +77,6 @@ jobs:
uses: './' uses: './'
with: with:
install_components: 'cloud-run-proxy' install_components: 'cloud-run-proxy'
skip_tool_cache: true
- name: 'Check components' - name: 'Check components'
run: 'npm run integration' run: 'npm run integration'
@ -93,7 +88,6 @@ jobs:
uses: './' uses: './'
with: with:
project_id: '${{ vars.PROJECT_ID }}' project_id: '${{ vars.PROJECT_ID }}'
skip_tool_cache: true
- name: 'Check project ID' - name: 'Check project ID'
run: 'npm run integration' run: 'npm run integration'
@ -109,8 +103,6 @@ jobs:
- name: 'Setup gcloud with WIF' - name: 'Setup gcloud with WIF'
uses: './' uses: './'
with:
skip_tool_cache: true
- name: 'Check WIF authentication' - name: 'Check WIF authentication'
run: 'npm run integration' run: 'npm run integration'
@ -126,8 +118,6 @@ jobs:
- name: 'Setup gcloud with SAKE' - name: 'Setup gcloud with SAKE'
uses: './' uses: './'
with:
skip_tool_cache: true
- name: 'Check SAKE authentication' - name: 'Check SAKE authentication'
run: 'npm run integration' run: 'npm run integration'

View file

@ -1,7 +1,6 @@
# `setup-gcloud` GitHub Action # `setup-gcloud` GitHub Action
Configures the [Google Cloud SDK][sdk] in the GitHub Actions environment. The Google Cloud SDK includes both the [gcloud][gcloud] and Configures the [Google Cloud SDK][sdk] in the GitHub Actions environment. The Google Cloud SDK includes the [gcloud][gcloud] binary.
[gsutil][gsutil] binaries.
Or integrate natively with other Google Cloud GitHub Actions: Or integrate natively with other Google Cloud GitHub Actions:
@ -23,7 +22,7 @@ support](https://cloud.google.com/support).**
- This action requires Google Cloud credentials to execute gcloud commands. - This action requires Google Cloud credentials to execute gcloud commands.
See [Authorization](#Authorization) for more details. See [Authorization](#Authorization) for more details.
- This action runs using Node 20. If you are using self-hosted GitHub Actions - This action runs using Node 24. If you are using self-hosted GitHub Actions
runners, you must use a [runner runners, you must use a [runner
version](https://github.com/actions/virtual-environments) that supports this version](https://github.com/actions/virtual-environments) that supports this
version or newer. version or newer.
@ -46,7 +45,7 @@ jobs:
service_account: 'my-service-account@my-project.iam.gserviceaccount.com' service_account: 'my-service-account@my-project.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK' - name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2' uses: 'google-github-actions/setup-gcloud@v3'
with: with:
version: '>= 363.0.0' version: '>= 363.0.0'
@ -63,7 +62,7 @@ jobs:
value is `"latest"`, which will always download and install the latest value is `"latest"`, which will always download and install the latest
available Cloud SDK version. available Cloud SDK version.
- uses: 'google-github-actions/setup-gcloud@v2' - uses: 'google-github-actions/setup-gcloud@v3'
with: with:
version: '>= 416.0.0' version: '>= 416.0.0'
@ -76,7 +75,7 @@ jobs:
or newer. If you need support for Workload Identity Federation, specify or newer. If you need support for Workload Identity Federation, specify
your version constraint as such: your version constraint as such:
- uses: 'google-github-actions/setup-gcloud@v2' - uses: 'google-github-actions/setup-gcloud@v3'
with: with:
version: '>= 363.0.0' version: '>= 363.0.0'
@ -102,13 +101,10 @@ jobs:
⚠️ You will not be able to install additional gcloud components, because the ⚠️ You will not be able to install additional gcloud components, because the
system installation is locked. system installation is locked.
- <a name="__input_skip_tool_cache"></a><a href="#user-content-__input_skip_tool_cache"><code>skip_tool_cache</code></a>: _(Optional)_ Skip transferring the downloaded artifacts into the runner's tool cache. - <a name="__input_cache"></a><a href="#user-content-__input_cache"><code>cache</code></a>: _(Optional)_ Transfer the downloaded artifacts into the runner's tool cache. On
On GitHub-managed runners, this makes no difference since they are GitHub-managed runners, this have very little impact since runneres are
ephemeral. On self-hosted runners, this controls whether the downloads are ephemeral. On self-hosted runners, this could improve future runs by
cached stored on the disk. skipping future gcloud installations.
For backwards-compatibility, this is is "false" by default. Setting the
value to "true" can significantly speed up installation times.
<!-- END_AUTOGEN_INPUTS --> <!-- END_AUTOGEN_INPUTS -->
@ -134,7 +130,7 @@ authenticate via the following options:
### Workload Identity Federation (preferred) ### Workload Identity Federation (preferred)
**⚠️ You must use the Cloud SDK version 390.0.0 or later to authenticate the **⚠️ You must use the Cloud SDK version 390.0.0 or later to authenticate the
`bq` and `gsutil` tools.** `bq` tool.**
```yaml ```yaml
jobs: jobs:
@ -152,7 +148,7 @@ jobs:
service_account: 'my-service-account@my-project.iam.gserviceaccount.com' service_account: 'my-service-account@my-project.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK' - name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2' uses: 'google-github-actions/setup-gcloud@v3'
- name: 'Use gcloud CLI' - name: 'Use gcloud CLI'
run: 'gcloud info' run: 'gcloud info'
@ -170,7 +166,7 @@ jobs:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: 'Set up Cloud SDK' - name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2' uses: 'google-github-actions/setup-gcloud@v3'
- name: 'Use gcloud CLI' - name: 'Use gcloud CLI'
run: 'gcloud info' run: 'gcloud info'
@ -187,7 +183,7 @@ jobs:
job_id: job_id:
steps: steps:
- name: 'Set up Cloud SDK' - name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2' uses: 'google-github-actions/setup-gcloud@v3'
- name: 'Use gcloud CLI' - name: 'Use gcloud CLI'
run: 'gcloud info' run: 'gcloud info'
@ -213,7 +209,7 @@ jobs:
service_account: 'service-account-1@my-project.iam.gserviceaccount.com' service_account: 'service-account-1@my-project.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK' - name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2' uses: 'google-github-actions/setup-gcloud@v3'
- name: 'Use gcloud CLI' - name: 'Use gcloud CLI'
run: 'gcloud auth list --filter=status:ACTIVE --format="value(account)"' run: 'gcloud auth list --filter=status:ACTIVE --format="value(account)"'
@ -225,7 +221,7 @@ jobs:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: 'Set up Cloud SDK' - name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2' uses: 'google-github-actions/setup-gcloud@v3'
- name: 'Use gcloud CLI' - name: 'Use gcloud CLI'
run: 'gcloud auth list --filter=status:ACTIVE --format="value(account)"' run: 'gcloud auth list --filter=status:ACTIVE --format="value(account)"'
@ -238,7 +234,7 @@ jobs:
We recommend pinning to the latest available major version: We recommend pinning to the latest available major version:
```yaml ```yaml
- uses: 'google-github-actions/setup-gcloud@v2' - uses: 'google-github-actions/setup-gcloud@v3'
``` ```
While this action attempts to follow semantic versioning, but we're ultimately While this action attempts to follow semantic versioning, but we're ultimately
@ -246,7 +242,7 @@ human and sometimes make mistakes. To prevent accidental breaking changes, you
can also pin to a specific version: can also pin to a specific version:
```yaml ```yaml
- uses: 'google-github-actions/setup-gcloud@v2.0.0' - uses: 'google-github-actions/setup-gcloud@v3.0.0'
``` ```
However, you will not get automatic security updates or new features without However, you will not get automatic security updates or new features without
@ -261,7 +257,6 @@ explicitly updating your version number. Note that we only publish `MAJOR` and
[sdk]: https://cloud.google.com/sdk/ [sdk]: https://cloud.google.com/sdk/
[gcloud]: https://cloud.google.com/sdk/gcloud/ [gcloud]: https://cloud.google.com/sdk/gcloud/
[gcloud-credentials]: https://cloud.google.com/docs/authentication/gcloud#gcloud-credentials [gcloud-credentials]: https://cloud.google.com/docs/authentication/gcloud#gcloud-credentials
[gsutil]: https://cloud.google.com/storage/docs/gsutil
[sa-iam-docs]: https://cloud.google.com/iam/docs/service-accounts [sa-iam-docs]: https://cloud.google.com/iam/docs/service-accounts
[sa]: https://cloud.google.com/iam/docs/creating-managing-service-accounts [sa]: https://cloud.google.com/iam/docs/creating-managing-service-accounts
[wif]: https://cloud.google.com/iam/docs/workload-identity-federation [wif]: https://cloud.google.com/iam/docs/workload-identity-federation

View file

@ -26,7 +26,7 @@ inputs:
value is `"latest"`, which will always download and install the latest value is `"latest"`, which will always download and install the latest
available Cloud SDK version. available Cloud SDK version.
- uses: 'google-github-actions/setup-gcloud@v2' - uses: 'google-github-actions/setup-gcloud@v3'
with: with:
version: '>= 416.0.0' version: '>= 416.0.0'
@ -39,7 +39,7 @@ inputs:
or newer. If you need support for Workload Identity Federation, specify or newer. If you need support for Workload Identity Federation, specify
your version constraint as such: your version constraint as such:
- uses: 'google-github-actions/setup-gcloud@v2' - uses: 'google-github-actions/setup-gcloud@v3'
with: with:
version: '>= 363.0.0' version: '>= 363.0.0'
@ -77,15 +77,12 @@ inputs:
default: false default: false
required: false required: false
skip_tool_cache: cache:
description: |- description: |-
Skip transferring the downloaded artifacts into the runner's tool cache. Transfer the downloaded artifacts into the runner's tool cache. On
On GitHub-managed runners, this makes no difference since they are GitHub-managed runners, this have very little impact since runneres are
ephemeral. On self-hosted runners, this controls whether the downloads are ephemeral. On self-hosted runners, this could improve future runs by
cached stored on the disk. skipping future gcloud installations.
For backwards-compatibility, this is is "false" by default. Setting the
value to "true" can significantly speed up installation times.
default: false default: false
required: false required: false
@ -99,5 +96,5 @@ branding:
color: 'blue' color: 'blue'
runs: runs:
using: 'node20' using: 'node24'
main: 'dist/index.js' main: 'dist/index.js'

6
dist/index.js vendored

File diff suppressed because one or more lines are too long

38
package-lock.json generated
View file

@ -1,18 +1,18 @@
{ {
"name": "setup-gcloud", "name": "setup-gcloud",
"version": "2.2.1", "version": "3.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "setup-gcloud", "name": "setup-gcloud",
"version": "2.2.1", "version": "3.0.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/tool-cache": "^2.0.2", "@actions/tool-cache": "^2.0.2",
"@google-github-actions/actions-utils": "^0.8.10", "@google-github-actions/actions-utils": "^0.8.10",
"@google-github-actions/setup-cloud-sdk": "^1.2.3" "@google-github-actions/setup-cloud-sdk": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.3.1", "@eslint/eslintrc": "^3.3.1",
@ -30,8 +30,8 @@
"typescript-eslint": "^8.40.0" "typescript-eslint": "^8.40.0"
}, },
"engines": { "engines": {
"node": ">= 20.x", "node": ">= 24.x",
"npm": ">= 10.x" "npm": ">= 11.x"
} }
}, },
"node_modules/@actions/core": { "node_modules/@actions/core": {
@ -249,21 +249,37 @@
} }
}, },
"node_modules/@google-github-actions/setup-cloud-sdk": { "node_modules/@google-github-actions/setup-cloud-sdk": {
"version": "1.2.3", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@google-github-actions/setup-cloud-sdk/-/setup-cloud-sdk-1.2.3.tgz", "resolved": "https://registry.npmjs.org/@google-github-actions/setup-cloud-sdk/-/setup-cloud-sdk-2.0.0.tgz",
"integrity": "sha512-6k+yIVvxqkp21LMaxytVvIrnyvvLBH5ezKePkIxoFBvcKIOTTpf7L5B5KlMBUHzyjTsNIohtu5iHg+AEBAD8ug==", "integrity": "sha512-ZrfolwXPE3C2kzyunxeb77TtUQv765aIG2LD7lGXtA9q4WRBoo5xj1I1Mu9d/od2tKvhFh2RwSiRxdBvZMcfxQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/http-client": "^2.2.3", "@actions/http-client": "^2.2.3",
"@actions/tool-cache": "^2.0.2", "@actions/tool-cache": "^2.0.2",
"@google-github-actions/actions-utils": "^0.8.10", "@google-github-actions/actions-utils": "^1.0.1",
"semver": "^7.7.2" "semver": "^7.7.2"
}, },
"engines": { "engines": {
"node": ">= 20.x", "node": ">= 24.x",
"npm": ">= 10.x" "npm": ">= 11.x"
}
},
"node_modules/@google-github-actions/setup-cloud-sdk/node_modules/@google-github-actions/actions-utils": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@google-github-actions/actions-utils/-/actions-utils-1.0.1.tgz",
"integrity": "sha512-dEvNcy63a6pkcMsRhWbfjNePsv4kR61O56mQ9rVXvRgjAvRkZTBiM1G7QSnHulMEjhLIlTEGlBIKEKIxCoonkQ==",
"license": "Apache-2.0",
"dependencies": {
"yaml": "^2.8.1"
},
"bin": {
"actions-gen-readme": "bin/actions-gen-readme.mjs"
},
"engines": {
"node": ">= 24.x",
"npm": ">= 11.x"
} }
}, },
"node_modules/@google-github-actions/setup-cloud-sdk/node_modules/semver": { "node_modules/@google-github-actions/setup-cloud-sdk/node_modules/semver": {

View file

@ -1,6 +1,6 @@
{ {
"name": "setup-gcloud", "name": "setup-gcloud",
"version": "2.2.1", "version": "3.0.1",
"description": "Setup gcloud GitHub action", "description": "Setup gcloud GitHub action",
"main": "dist/main/index.js", "main": "dist/main/index.js",
"scripts": { "scripts": {
@ -12,8 +12,8 @@
"test": "node --require ts-node/register --test-reporter spec --test tests/setup-gcloud.test.ts" "test": "node --require ts-node/register --test-reporter spec --test tests/setup-gcloud.test.ts"
}, },
"engines": { "engines": {
"node": ">= 20.x", "node": ">= 24.x",
"npm": ">= 10.x" "npm": ">= 11.x"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -33,7 +33,7 @@
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/tool-cache": "^2.0.2", "@actions/tool-cache": "^2.0.2",
"@google-github-actions/actions-utils": "^0.8.10", "@google-github-actions/actions-utils": "^0.8.10",
"@google-github-actions/setup-cloud-sdk": "^1.2.3" "@google-github-actions/setup-cloud-sdk": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.3.1", "@eslint/eslintrc": "^3.3.1",

View file

@ -48,7 +48,7 @@ export async function run(): Promise<void> {
// Warn if pinned to HEAD // Warn if pinned to HEAD
if (isPinnedToHead()) { if (isPinnedToHead()) {
core.warning(pinnedToHeadWarning('v2')); core.warning(pinnedToHeadWarning('v3'));
} }
try { try {
@ -56,7 +56,7 @@ export async function run(): Promise<void> {
let version = presence(core.getInput('version')); let version = presence(core.getInput('version'));
const components = core.getInput('install_components'); const components = core.getInput('install_components');
const projectId = core.getInput('project_id'); const projectId = core.getInput('project_id');
const skipToolCache = parseBoolean(core.getInput('skip_tool_cache')); const cache = parseBoolean(core.getInput('cache'));
if (skipInstall) { if (skipInstall) {
core.info(`Skipping installation ("skip_install" was true)`); core.info(`Skipping installation ("skip_install" was true)`);
@ -91,7 +91,7 @@ export async function run(): Promise<void> {
core.addPath(path.join(toolPath, 'bin')); core.addPath(path.join(toolPath, 'bin'));
} else { } else {
core.debug(`no version of gcloud matching "${version}" is installed`); core.debug(`no version of gcloud matching "${version}" is installed`);
await installGcloudSDK(version, skipToolCache); await installGcloudSDK(version, cache);
} }
} }