upload-google-play: Error with userFraction

Fails with userFraction: ‘1.0’ with the error:

Error: A provided userFraction must be between 0.0 and 1.0, inclusive-inclusive

My workflow:

name: My reusable workflow

on:
  workflow_call:
    inputs:
      track:
        description: Release type in Play Console, possible values are production, beta, alpha, internal, internalsharing or a custom track
        type: string
      userFraction:
        description: Percentage of users who should get this release
        type: string
        default: 1.0
      inAppUpdatePriority:
        description: Priority for inApp updates where 0 represents a minimum priority and 5 the higher one
        type: string
        default: 0

jobs:
  deploy-package:
    name: Deploy package
    runs-on: ubuntu-latest
    steps:
      - id: checkout-repository
        name: Checkout repository
        uses: actions/checkout@v3
      - id: setup-java
        name: Setup Java
        if: success()
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '11'
          cache: 'gradle'
      - id: build-artifact
        name: Build artifact
        if: success()
        run: bash ${GITHUB_WORKSPACE}/.github/scripts/compile-package.sh # produces outputs with aab and mapping paths
      - id: publish-in-play-console
        name: Publish in Play Console
        if: |
          success() &&
          steps.build-artifact.outputs.package-file-path != null
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJsonPlainText: ${{secrets.PLAY_CONSOLE_SERVICE_ACCOUNT }}
          packageName: com.myapp
          releaseFiles: ${{ steps.build-artifact.outputs.package-file-path }}
          track: ${{ inputs.track }}
          userFraction: ${{ inputs.userFraction }}
          inAppUpdatePriority: ${{ inputs.inAppUpdatePriority }}
          mappingFile: ${{ steps.build-artifact.outputs.mapping-file-path }}
          whatsNewDirectory: ${GITHUB_WORKSPACE}/assets/whatsnew

I launch this reusable workflow from a dispatcher one:

name: Deploy manually

on:
  workflow_dispatch:
    inputs:
      track:
        description: Type of publish
        type: choice
        required: true
        options:
          - Production
          - Beta
          - Internal
      userFraction:
        description: Percentage of deploy (0.0 to 1.0)
        type: string
        required: true
        default: 1.0
      inAppUpdatePriority:
        description: InApp update priority (0=lower and 5=highest)
        type: string
        required: true
        default: 0

jobs:
  deploy:
    uses: ./.github/workflows/my_reusable_workflow.yaml
    secrets: inherit
    with:
      track: ${{ inputs.track }}
      userFraction: ${{ inputs.userFraction }}
      inAppUpdatePriority: ${{ inputs.inAppUpdatePriority }}

Checking my logs the userFraction that the reusable workflow receive is correct '1.0'

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15

Most upvoted comments

Hey there! Sorry for the misleading error, having a userFraction of 0 and 1 is not supported by the API, so the value should be exclusive-exclusive. I have a change in review that rectifies this + adds tests to prevent future regressions

It should not.

This is what i got

'userFraction' must be between 0 and 1! Got 1

Seems like it’s working fine for you, a user fraction of 1 is not valid. Set your status to completed and remove the userFraction

Now i got:

Error: 'userFraction' must be a number! Got NaN