Creating LiteFS cluster with GHA says my token is unauthorized

I’ve created a workflow to initialize my app and I have a step that sets up a new LiteFS cluster that looks like this:

- name: 📡 Create LiteFS Cloud cluster
  shell: bash
  run: |
    flyctl litefs-cloud clusters create my-testing-cluster -o personal -r iad
  env:
    FLY_API_TOKEN: ${{ secrets.fly_api_token }}

This command works locally, but when used in the action I get this error message:

Error: failed creating litefs-cloud token: input:3: createLimitedAccessToken Not authorized to access this createlimitedaccesstoken

I’m using this token for other steps that complete successfully, so that’s not the issue. I’ve tried generating a new Organization token as well as a Deploy token, but I get the same response. I might try to automate fly auth but was wondering if I’m missing something that could avoid that.

Do you need to wrap ${{ secrets.fly_api_token }} in quotes?

FLY_API_TOKEN: "${{ secrets.fly_api_token }}"

No that doesn’t seem to change anything. I double checked by just using a static value there
FLY_API_TOKEN: "FlyV1 fm2_lJXXXXXX12345"
but there was no difference

I am confident the token is correct and getting set for this job. If I change the run command to something like:
flyctl redis list or
flyctl app list

I see the correct response. But if I try getting a list of litefs clusters
flyctl litefs-cloud clusters list -o personal
I see the same error in OP

This seems fixed with the newest release 0.2.47, along with the secret name typo returned (Linking to a LiteFS cluster didn't work with provided secret on creation)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.