terraform-switcher: Unable to get terraform switcher install working via Github actions

Is your feature request related to a problem? Please describe.

I am trying to install terraform switcher into an Ubuntu container via GitHub actions:

- name: install tfswitch
      run: |
            echo "Installing tfswitch locally"
            wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine
            chmod 755 install.sh            #Make installer executable
            ./install.sh -b `pwd`/.bin      #Install tfswitch in a location you have permission
            CUSTOMBIN=`pwd`/.bin            #set custom bin path
            export PATH=$PATH:$CUSTOMBIN    #Add custom bin path to PATH environment
            tfswitch -b $CUSTOMBIN/terraform 0.11.7
            terraform -v                    #testing version

I get this error -

##[debug]Evaluating condition for step: 'install tfswitch'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: install tfswitch
##[debug]Loading inputs
##[debug]Loading env
Run echo "Installing tfswitch locally"
##[debug]Overwrite 'working-directory' base on job defaults.
##[debug]sh -e /__w/_temp/6b5879f4-c87[2](https://github.com/DigitalTitleGroup/seq-infra-tf-federated-iam/actions/runs/12242560574/job/34150152134#step:8:2)-4feb-8c8a-e0cbb8bc80c6.sh
Installing tfswitch locally
--2024-12-09 11:11:46--  https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.1[3](https://github.com/DigitalTitleGroup/seq-infra-tf-federated-iam/actions/runs/12242560574/job/34150152134#step:8:3)3, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:[4](https://github.com/DigitalTitleGroup/seq-infra-tf-federated-iam/actions/runs/12242560574/job/34150152134#step:8:4)43... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9272 (9.1K) [text/plain]
Saving to: ‘install.sh’
     0K .........                                             100% 1.11M=0.008s
2024-12-09 11:11:4[7](https://github.com/DigitalTitleGroup/seq-infra-tf-federated-iam/actions/runs/12242560574/job/34150152134#step:8:7) (1.11 MB/s) - ‘install.sh’ saved [9272/9272]
warrensbox/terraform-switcher info checking GitHub for tag 'v1.2.4'
warrensbox/terraform-switcher crit unable to find 'v1.2.4' - use 'latest' or see https://github.com/warrensbox/terraform-switcher/releases for details
Error: Process completed with exit code 1.
##[debug]Finishing: install tfswitch

Describe the solution you’d like

I’d expect it to install tfswitch seamlessly onto the container. Any assistance with this issue would be appreciated!

About this issue

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

Most upvoted comments

Glad to hear. You don’t need to supply -b for /usr/local/bin as /usr/local/bin is implied (is default value for -b arg).