Skip to content

Commit 0a148a4

Browse files
committed
Fix cpflow token propagation
1 parent 1e46bfe commit 0a148a4

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/actions/cpflow-setup-environment/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ runs:
4040
sudo npm install -g @controlplane/cli@${{ inputs.cpln_cli_version }}
4141
cpln --version
4242
43-
gem install cpflow -v ${{ inputs.cpflow_version }}
43+
gem install cpflow -v ${{ inputs.cpflow_version }} --no-document
4444
cpflow --version
4545
4646
- name: Setup Control Plane profile and registry login
@@ -63,6 +63,14 @@ runs:
6363
exit 1
6464
fi
6565
66+
# Make the token available to later workflow steps without putting it on argv.
67+
token_delimiter="CPLN_TOKEN_$(openssl rand -hex 8)"
68+
{
69+
echo "CPLN_TOKEN<<${token_delimiter}"
70+
printf '%s\n' "$CPLN_TOKEN"
71+
echo "${token_delimiter}"
72+
} >> "$GITHUB_ENV"
73+
6674
create_output=""
6775
if ! create_output="$(cpln profile create default --org "$ORG" 2>&1)"; then
6876
if ! echo "$create_output" | grep -qi "already exists"; then

.github/workflows/cpflow-deploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393

9494
deploy:
9595
needs: [validate-branch, build]
96-
if: needs.validate-branch.outputs.is_deployable == 'true'
96+
if: needs.validate-branch.outputs.is_deployable == 'true' && needs.build.result == 'success'
9797
runs-on: ubuntu-latest
9898
steps:
9999
- name: Checkout repository

0 commit comments

Comments
 (0)