Skip to content

feat: add version_file input to read the gcloud version from a file#736

Open
somaz94 wants to merge 1 commit into
google-github-actions:mainfrom
somaz94:feat/version-file
Open

feat: add version_file input to read the gcloud version from a file#736
somaz94 wants to merge 1 commit into
google-github-actions:mainfrom
somaz94:feat/version-file

Conversation

@somaz94

@somaz94 somaz94 commented Jun 24, 2026

Copy link
Copy Markdown

Adds an optional version_file input that resolves the Cloud SDK version from a file, mirroring the *-version-file pattern in actions/setup-go, actions/setup-node, and actions/setup-python.

Two formats are supported:

  • a plain version file containing a single version string or constraint (e.g. 416.0.0 or >= 416.0.0)
  • an asdf/mise .tool-versions file containing a gcloud <version> line

Precedence: an explicitly set version (anything other than the default latest) wins and version_file is ignored with a warning. The version-resolution logic is unchanged once a concrete version is determined, so the existing install/cache path is reused as-is.

Validation (run locally):

  • npm run lint (eslint) passes
  • npm test passes, 22/22 (added 3 run() cases for .tool-versions / plain file / version precedence, plus 5 parseVersionFile unit cases)
  • npm run build (ncc) rebuilt dist/index.js
  • npm run docs regenerated the README inputs section

@google-cla

google-cla Bot commented Jun 24, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@somaz94 somaz94 marked this pull request as ready for review June 24, 2026 06:28
@somaz94 somaz94 requested a review from a team as a code owner June 24, 2026 06:28
@somaz94 somaz94 requested review from R2wenD2 and kkarrenn June 24, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant