Skip to content

mataku/update-rollout-google-play-release-action

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update Rollout Google Play Release Action

CI Check dist/

A GitHub Action to update the user fraction (rollout percentage) for in-progress Google Play Console releases.

Features

  • Update rollout percentage (user fraction) for in-progress Google Play Console releases
  • Target specific releases by version name and track
  • Only updates releases with inProgress status
  • Support for both Service Account and External Account authentication
  • Detailed logging for troubleshooting

Prerequisites

Before using this action, you need to setup using Workload Identity Federation described in https://github.com/google-github-actions/auth.

Or by using Service Account:

  1. Set up Google Play Console API access:

    • Enable the Google Play Android Developer API in your Google Cloud Console
    • Create a service account with appropriate permissions
    • Download the JSON credentials file
  2. Grant the service account access to your app in Google Play Console:

    • Go to Google Play Console > Settings > API access
    • Link your Google Cloud project
    • Grant access to the service account with at least "Release to production" or "Release to testing tracks" permission

Usage

Using Workload Identity Federation with GOOGLE_APPLICATION_CREDENTIALS

Use google-github-actions/auth to authenticate with Workload Identity Federation. The action will automatically use the GOOGLE_APPLICATION_CREDENTIALS environment variable set by google-github-actions/auth:

steps:
  - name: Authenticate to Google Cloud
    uses: google-github-actions/auth@v3
    with:
      create_credentials_file: true
      workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
      service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

  - name: Update Google Play Rollout
    uses: mataku/update-rollout-google-play-release-action@v1
    with:
      package-name: 'com.example.app'
      version-name: '1.0.0'
      track: 'production'
      user-fraction: '0.2'

Using Workload Identity Federation with File Path

Alternatively, you can explicitly pass the generated credentials file path:

steps:
  - name: Authenticate to Google Cloud
    id: auth
    uses: google-github-actions/auth@v3
    with:
      create_credentials_file: true
      workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
      service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

  - name: Update Google Play Rollout
    uses: mataku/update-rollout-google-play-release-action@v1
    with:
      package-name: 'com.example.app'
      version-name: '1.0.0'
      google-account-json-file-path:
        ${{ steps.auth.outputs.credentials_file_path }}
      track: 'production'
      user-fraction: '0.2'

Using Service Account JSON from Secrets

Store your service account JSON as a GitHub secret and pass it directly:

steps:
  - name: Update Google Play Rollout
    uses: mataku/update-rollout-google-play-release-action@v1
    with:
      package-name: 'com.example.app'
      version-name: '1.0.0'
      google-account-json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
      track: 'production'
      user-fraction: '0.2'

Inputs

Input Description Required Default
package-name The package name of the Android application (e.g., com.example.app) Yes -
version-name The version name to update rollout (e.g., 1.0.0) Yes -
google-account-json-file-path Path to the Google Cloud account JSON file for authentication (service account or external account) No (if google-account-json set or GOOGLE_APPLICATION_CREDENTIALS is set) -
google-account-json Google Cloud account JSON content for authentication (service account or external account) No (if file path set or GOOGLE_APPLICATION_CREDENTIALS is set) -
track The release track to update (production, beta, alpha, internal) Yes production
user-fraction The user fraction to set (greater than 0.0 and less than 1.0, e.g., 0.1 for 10%) Yes -

Note: Either google-account-json-file-path, google-account-json, or the GOOGLE_APPLICATION_CREDENTIALS environment variable must be provided. Priority order: GOOGLE_APPLICATION_CREDENTIALS > google-account-json > google-account-json-file-path.

Error Handling

The action will fail if:

  • None of GOOGLE_APPLICATION_CREDENTIALS, google-account-json-file-path, or google-account-json is provided
  • The specified version name is not found in the track
  • The release is not in inProgress status
  • The user-fraction value is not greater than 0.0 and less than 1.0
  • Authentication fails
  • The Google account doesn't have sufficient permissions
  • Network errors occur during API calls

Check the action logs for detailed error messages.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A GitHub Action to update the user fraction (rollout percentage) for in-progress Google Play Console releases.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Generated from actions/typescript-action