tolgee / tolgee-cli

The Tolgee CLI
MIT License
16 stars 11 forks source link

Release 2.1.0 broken #92

Closed broncha closed 3 months ago

broncha commented 3 months ago

We had this step in our CI which was working perfectly fine, until today's release.

TOLGEE_API_KEY=tgpak_.......  tolgee pull --path assets/js/src/i18n
🔴 The specified API key cannot be used to perform operations on the specified project.
🔵 The API key you specified is tied to project #1, you tried to perform operations on project #1.
🔵 Learn more about how API keys in Tolgee work here: https://tolgee.io/platform/account_settings/api_keys_and_pat_tokens

downgrading to 2.0.4 works as expected

npm install --global @tolgee/cli@2.0.4
TOLGEE_API_KEY=tgpak_.........  tolgee pull --path assets/js/src/i18n
🐭✅     Fetching strings from Tolgee...
🐭✅     Extracting strings...
✅ Done!
stepan662 commented 3 months ago

Hello, thanks for the report, I've made some changes in a way how values are loaded from config and I found an issue that the Id wasn't properly converted to string, so the comparison failed.

I can't think of any other bug that could be causing this, do you have your projectId specified as string in tolgee config?

broncha commented 3 months ago

Yes the project ID in .tolgeerc is a string

{
    "apiUrl": "https://tolgee.......com",
    "projectId": "1"
}

changing projectId to a number worked with the latest cli version

stepan662 commented 3 months ago

Ok, thanks. Then it's fixed in the PR 👍