Sign inSign up

puzzlers/chrome-webstore-publish

By puzzlers

•Updated about 1 year ago

GitHub Action to push and publish Chrome Webstore Extensions

Image
Developer tools
1

1.6K

puzzlers/chrome-webstore-publish repository overview

Chrome Webstore Push Banner

Test Status Docker Build Code Coverage Code Coverage Docker Pulls

⁠Chrome Webstore Publish GitHub Action

GitHub Action to upload and publish Chrome extension ZIP or CRX files to the Chrome Web Store using the official Chrome Web Store API. Supports publishing to public or trusted testers, CRX signing, and expedited review process.

⁠Features

  • Uploads a new version of an existing Chrome extension.
  • Optionally signs and uploads as CRX if a private key is provided
  • Publishes the extension to the public or trusted testers
  • Handles OAuth2 token refresh automatically
  • Supports expedited review with fallback to regular review
  • Provides clear logs and error messages
  • Runs in a Docker container making it runner agnostic.

⁠Prerequisites

  • The extension must already exist in the Chrome Web Store (first publish must be manual).
  • You must have a Google Cloud project with the Chrome Web Store API enabled.
  • OAuth2 credentials (client ID, client secret, refresh token) with https://www.googleapis.com/auth/chromewebstore scope.
  • Follow this documentation to generate the client credentials and refresh token - https://developer.chrome.com/docs/webstore/using-api⁠.

⁠Inputs

NameDescriptionRequired
extension_idThe Chrome Web Store extension IDYes
zip_file_pathPath to the extension ZIP fileYes
client_idGoogle Cloud OAuth2 client IDYes
client_secretGoogle Cloud OAuth2 client secretYes
refresh_tokenOAuth2 refresh token of the user that has access to webstore api scope.Yes
publish_targetPublish target: public or testersNo (default: public)
expedited_reviewRequest expedited review if eligible (true/false). Falls back to regular review if not eligible.No (default: false)
crx_private_keyCRX signing private key (PEM string). If provided, the extension will be signed and uploaded as a CRX.No
crx_private_key_pathPath to the CRX signing private key (PEM file). If provided, the extension will be signed and uploaded as a CRX.No

Note: Only one of crx_private_key or crx_private_key_path should be provided. If neither is provided, the extension is uploaded as a ZIP.

⁠Example Usage

name: Publish Chrome Extension
on:
  push:
    branches: [main]
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Publish to Chrome Web Store
        uses: puzzlers-labs/chrome-webstore-publish@v1
        with:
          extension_id: ${{ vars.CHROME_EXTENSION_ID }}
          zip_file_path: ./dist/extension.zip
          client_id: ${{ secrets.GOOGLE_CLIENT_ID }}
          client_secret: ${{ secrets.GOOGLE_CLIENT_SECRET }}
          refresh_token: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
          publish_target: public # Or `testers` for internal publishing target to TrustedTesters.
          expedited_review: true # This does not guarantee an expedited Review process. But it makes an attempt.
          # Only one of the following should be provided:
          # crx_private_key: ${{ secrets.CRX_PRIVATE_KEY }}
          # crx_private_key_path: ./path/to/key.pem

⁠Error Handling & Logs

  • The action logs progress and errors to the console.
  • The workflow fails if required inputs are missing or invalid.
  • All API errors and upload/publish failures are reported in the logs.

⁠Contributions

Refer to CONTRIBUTING.MD⁠

⁠License

Apache-2.0⁠

Tag summary

Content type

Image

Digest

sha256:873cc9cc9…

Size

365.3 MB

Last updated

about 1 year ago

docker pull puzzlers/chrome-webstore-publish