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.
To setup API access you need to specify clientId
, clientSecret
and refreshToken
inputs.
To find out how to obtain them you can read:
clientId
RequiredclientSecret
RequiredrefreshToken
Required
Don't forget to store these values in secrets!
accessToken
fetched access token
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 }}
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.