fix(ci): require bridge auth token before deploy
This commit is contained in:
parent
49637e87ea
commit
6db48ee738
14
.github/workflows/pipeline.yml
vendored
14
.github/workflows/pipeline.yml
vendored
@ -229,9 +229,21 @@ jobs:
|
||||
- name: Export deploy secrets
|
||||
run: |
|
||||
{
|
||||
echo "BRIDGE_AUTH_TOKEN=${{ github.event_name == 'workflow_dispatch' && inputs.internal_service_token || steps.vault.outputs.INTERNAL_SERVICE_TOKEN }}"
|
||||
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ inputs.internal_service_token }}" ]]; then
|
||||
echo "BRIDGE_AUTH_TOKEN=${{ inputs.internal_service_token }}"
|
||||
else
|
||||
echo "BRIDGE_AUTH_TOKEN=${{ steps.vault.outputs.INTERNAL_SERVICE_TOKEN }}"
|
||||
fi
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: Validate deploy secrets
|
||||
run: |
|
||||
if [[ -z "${BRIDGE_AUTH_TOKEN}" ]]; then
|
||||
echo "::error::BRIDGE_AUTH_TOKEN is empty. Provide it via the workflow_dispatch input, or ensure kv/data/github-actions/xworkmate-bridge INTERNAL_SERVICE_TOKEN is readable from Vault."
|
||||
exit 1
|
||||
fi
|
||||
echo "BRIDGE_AUTH_TOKEN length=${#BRIDGE_AUTH_TOKEN}"
|
||||
|
||||
- name: Checkout playbooks repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user