GithubHelp home page GithubHelp logo

google-github-actions / setup-cloud-sdk Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 13.0 2.82 MB

An NPM package for installing and configuring the Google Cloud SDK in GitHub Actions.

Home Page: https://cloud.google.com/sdk/docs

License: Apache License 2.0

JavaScript 4.67% TypeScript 89.77% Go 5.56%
actions gcloud gcp github-actions google-cloud google-cloud-platform npm

setup-cloud-sdk's Introduction

Setup Cloud SDK for GitHub Actions API client for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

Table of contents:

This is not an officially supported Google product, and it is not covered by a Google Cloud support contract. To report bugs or request features in a Google Cloud product, please contact Google Cloud support.

Installing the client library

npm install @google-github-actions/setup-cloud-sdk

Using the client library

import * as core from '@actions/core';
import * as toolCache from '@actions/tool-cache';
import * as setupGcloud from '@google-github-actions/setup-cloud-sdk';

// Install gcloud if not already installed.
const gcloudVersion = await setupGcloud.getLatestGcloudSDKVersion();

if (!setupGcloud.isInstalled(gcloudVersion)) {
  await setupGcloud.installGcloudSDK(gcloudVersion);
} else {
  const toolPath = toolCache.find('gcloud', gcloudVersion);
  core.addPath(path.join(toolPath, 'bin'));
}

// Authenticate gcloud SDK.
if (credentials) await setupGcloud.authenticateGcloudSDK(credentials);

const authenticated = await setupGcloud.isAuthenticated();
if (!authenticated) {
  throw new Error('Error authenticating the Cloud SDK.');
}

const toolCommand = setupGcloud.getToolCommand();

Versioning

This library follows Semantic Versioning.

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE

setup-cloud-sdk's People

Contributors

averikitsch avatar bharathkkb avatar dependabot[bot] avatar frodothetrue avatar google-github-actions-bot avatar sethvargo avatar verbanicm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

setup-cloud-sdk's Issues

Support CLOUDSDK_AUTH_ACCESS_TOKEN for authentication

TL;DR

Support CLOUDSDK_AUTH_ACCESS_TOKEN

Detailed design

The CLI supports CLOUDSDK_AUTH_ACCESS_TOKEN, but the github action and the setup-cloud-sdk does not support it (from what I've experimented). Is there a way to authenticate with the $CLOUDSDK_AUTH_ACCESS_TOKEN or any other env variables?

Additional information

We would like to run google-github-actions/setup-gcloud with CLOUDSDK_AUTH_ACCESS_TOKEN and the Project ID. Unfortunately we cannot run the auth action but have to rely on a home grown solution to obtain a short lived credential.

Set user-agent when downloading the SDK

TL;DR

Set a custom user-agent to google-github-actions:setup-gcloud/version when downloading the SDK.

Expected behavior

No response

Observed behavior

No response

Action YAML

no: true

Log output

No response

Additional information

No response

Use --format json where possible

TL;DR

The current implementation relies heavily on parsing stdin/stdout. However, that isn't guaranteed to be stable. Where possible, we should switch to using machine-parseable output, including in tests.

Expected behavior

No response

Observed behavior

No response

Action YAML

not: applicable

Log output

No response

Additional information

No response

Refactor to use actions-utils

TL;DR

There are some parts here that we can refactor using actions-utils like parseServiceAccountKey, isWIFCredFile,

Detailed design

No response

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.