@@ -17,13 +17,13 @@ inputs:
1717 cpln_cli_version :
1818 description : >-
1919 @controlplane/cli version. Empty string falls back to the action's pinned default
20- so callers can pass a repository-variable-backed input unconditionally.
20+ so callers can pass `${{ vars.CPLN_CLI_VERSION }}` unconditionally.
2121 required : false
2222 default : " "
2323 cpflow_version :
2424 description : >-
2525 cpflow gem version. Empty string falls back to the action's pinned default
26- so callers can pass a repository-variable-backed input unconditionally.
26+ so callers can pass `${{ vars.CPFLOW_VERSION }}` unconditionally.
2727 required : false
2828 default : " "
2929
5252 CPLN_CLI_VERSION="${CPLN_CLI_VERSION:-${default_cpln_cli_version}}"
5353 CPFLOW_VERSION="${CPFLOW_VERSION:-${default_cpflow_version}}"
5454
55- sudo npm install -g "@controlplane/cli@${CPLN_CLI_VERSION}"
55+ npm_global_prefix="${HOME}/.npm-global"
56+ mkdir -p "${npm_global_prefix}"
57+ echo "${npm_global_prefix}/bin" >> "$GITHUB_PATH"
58+ export PATH="${npm_global_prefix}/bin:${PATH}"
59+
60+ npm install --global --prefix "${npm_global_prefix}" "@controlplane/cli@${CPLN_CLI_VERSION}"
5661 cpln --version
5762
5863 gem install cpflow -v "${CPFLOW_VERSION}" --no-document
7883 exit 1
7984 fi
8085
81- # Later workflow steps call cpflow/cpln, so persist the token without putting it on argv.
82- # This intentionally gives subsequent trusted steps in the same job a CPLN_TOKEN env var.
83- token_delimiter="CPLN_TOKEN_$(openssl rand -hex 8)"
84- {
85- echo "CPLN_TOKEN<<${token_delimiter}"
86- printf '%s\n' "$CPLN_TOKEN"
87- echo "${token_delimiter}"
88- } >> "$GITHUB_ENV"
89-
9086 create_output=""
9187 if ! create_output="$(cpln profile create default --org "$ORG" 2>&1)"; then
9288 if ! echo "$create_output" | grep -qi "already exists"; then
0 commit comments