Skip to content

cardinalby/webext-buildtools-chrome-webstore-upload-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Node.js CI

Upload your WebExtension to Chrome Web Store

Performs first step of WebExtension deployment: uploads zip to Chrome Web Store. See publish action to continue deployment.

Based on ChromeWebstoreBuilder package.

Inputs

  • zipFilePath Required
    Path to packed extension (relative to repository) You can use webext-buildtools-pack-extension-dir-action to pack your extension directory and provide this input from it's output

  • extensionId Required
    Your extension id in Chrome Web Store

  • To allow action accessing to Chrome Webstore API you can choose 2 ways:

    1. Set apiAccessToken input directly (you can obtain it using google-api-fetch-token-action)

    2. Set the following inputs to let action get access token for you. Read Using the Chrome Web Store Publish API, How to generate Google API keys to learn how to obtain these values.

      • apiClientId Required
      • apiClientSecret Required
      • apiRefreshToken Required

    Don't forget to store sensitive data as secrets.

  • To handle long item processing (if after upload API returns IN_PROGRESS state) optionally you can specify 2 following inputs to check until it has SUCCESS state:

    • waitForUploadCheckCount
      Checks count in case of upload finished with IN_PROGRESS status
    • waitForUploadCheckIntervalMs
      Checks interval in ms in case of upload finished with IN_PROGRESS status

Outputs

  • oldVersion Version of extension before uploading

  • newVersion Version of extension after uploading (if was uploaded)

  • newerVersionAlreadyUploadedError check if step failed
    true if failed because newer extension version is already uploaded

  • sameVersionAlreadyUploadedError check if step failed
    true if failed because same extension version is already uploaded

  • inReviewError check if step failed
    true if failed because item is currently in review and upload was rejected

Simple usage example

uses: cardinalby/webext-buildtools-chrome-webstore-action@v1
with:
  zipFilePath: 'build/extension.zip'
  extensionId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
  apiClientId: ${{ secrets.G_CLIENT_ID }}
  apiClientSecret: ${{ secrets.G_CLIENT_SECRET }}
  apiRefreshToken: ${{ secrets.G_REFRESH_TOKEN }}

Google refresh token expiration

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

To avoid that, schedule google-api-fetch-token-action action with the same credentials.


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

About

Deploy your WebExtension to Chrome Web Store

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •