How to pass the json file in github Action?

4.6k views Asked by At

I am trying to create the web flow to release the app on play store.

Here is the code:

- name: Upload to Google Play
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJson: ${{ SERVICE_ACCOUNT_JSON }}
          packageName: packagename
          releaseFile: app/release/app.aab
          track: internal
          whatsNewDirectory: distribution/whatsnew

But not able to understand how to pass the JSON service account file location at the serviceAccountJson key?

Do I need to store the file in the local and pass the path or I need to add the file in the Github secret?

1

There are 1 answers

0
Gabriel Kohen On

If you want to pass an actual JSON rather than the reference to the file you should use:

serviceAccountJsonPlainText: ${{ secrets.my-json-content-var}}

If you want to point to a file you can:

serviceAccountJson: /the-path-the-file-is-in/yourjsonfile.json

the file path is relative to the root of the repo.