Git Product home page Git Product logo

google-api-fetch-token-action's Introduction

Build Status

The purpose

The action fetches an access token from Google API.

It can be used to prevent your Refresh Token from being expired.

According to Google's guide, the refresh token might stop working if it has not been used for six months.

If you use it in your workflow running less often than 6 months, you can face the problem. Schedule this action to periodically access Google API and fetch access token to avoid that.

Based on typed-chrome-webstore-api package.

About Google API access

To setup API access you need to specify clientId, clientSecret and refreshToken inputs. To find out how to obtain them you can read:

Inputs

  • clientId Required
  • clientSecret Required
  • refreshToken Required

Don't forget to store these values in secrets!

Outputs

  • accessToken fetched access token

Usage example

Create a separate workflow with a scheduled job:

name: "fetch-access-token"
on:
  schedule:
    - cron:  '0 3 2 * *' # At 03:00 on day-of-month 2

jobs:
  fetchToken:
    runs-on: ubuntu-latest
    steps:
      - uses: cardinalby/google-api-fetch-token-action@v1
        with:
          clientId: ${{ secrets.G_API_CLIENT_ID }}
          clientSecret: ${{ secrets.G_API_CLIENT_SECRET }}
          refreshToken: ${{ secrets.G_API_REFRESH_TOKEN }}

See also

If you are developing WebExtension for Google Web Store, take a look at webext-buildtools-chrome-webstore-action to upload and publish your extension. It works nice together with this action utilizing the same refresh token.

If you are interested in the building the entire deployment workflow for WebExtension, you can read this article.

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.