transifex/cli

How do I bypass the restart terminal step for CI?

mateot1 opened this issue · 4 comments

Specifically, I'm trying to update a github workflow for pushing our string source file from the old client, which did something like this (probably copied from your now-outdated docs for Travis integration):

  pip install virtualenv
  virtualenv ~/env
  source ~/env/bin/activate
  pip install transifex-client
  sudo echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = '"$TRANSIFEX_USER"$'\npassword = '"$TRANSIFEX_PASSWORD"$'\ntoken = '"$TRANSIFEX_API_TOKEN"$'\n' > ~/.transifexrc
  tx push -s

I was kind of hoping I could just replace the first 4 lines installing via the python virtualenv with:

curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
source ~/.bashrc

But I still get /home/runner/work/_temp/(some unique id for the workflow run).sh: line 4: tx: command not found

Hey @mateot1, this is an github action issue. I believe following this thread will solve this problem.

I tried with

defaults:
  run:
    shell: bash -ieo pipefail {0}
....

and worked like a charm.

@codegaze thank you! that solves that issue, however now this line does not seem to be doing what it should:

sudo echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = '"$TRANSIFEX_USER"$'\npassword = '"$TRANSIFEX_PASSWORD"$'\ntoken = '"$TRANSIFEX_API_TOKEN"$'\n' > ~/.transifexrc

I get this error: Error getting API token: could not find a Transifex API host and/or TOKEN, please inspect your .transifexrc and .tx/config files

I didn't change anything about how the secret variables are configured in github, so I'm wondering if the new cli expects a different format in ~/.transifexrc?

Update: I checked my local version and realized it also had fields for api_hostname and rest_hostname, after adding those, it seems like it works!

Hey @mateot1, I'm glad you figured it out! I will close this one for now! :)