Commit 01665350 authored by Andres Anaya Amariels's avatar Andres Anaya Amariels 🚀
Browse files

fix: improve Go installation process in CI template

parent e9f53980
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -24,11 +24,20 @@ dev_secrets_in_repo:
    - when: always
  script:
    - |
      # Install Go if not installed
      # Install Go manually if not installed
      if ! command -v go >/dev/null 2>&1; then
        echo "Installing Go..."
        sudo apt-get update -y
        sudo apt-get install -y golang-go git
        echo "Installing Go from tarball..."
        GO_VERSION=1.22.6  # pick a stable version

        curl -LO https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
        tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
        rm go${GO_VERSION}.linux-amd64.tar.gz

        # Add Go to PATH for the current session
        export PATH=$PATH:/usr/local/go/bin
        echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc

        echo "Go installed: $(go version)"
      else
        echo "Go already installed: $(go version)"
      fi
@@ -41,6 +50,7 @@ dev_secrets_in_repo:
        
        # Ensure Go bin path is available
        export PATH=$PATH:$(go env GOPATH)/bin
        echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc
        
        echo "trufflehog installed successfully: $(trufflehog --version)"
      else