Skip to content

Commit

Permalink
Handle trailing slash in VAULT_SERVER url
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaso committed Nov 18, 2023
1 parent 16922d2 commit e532d74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ runs:
if: success() || steps.generator.conclusion == 'failure'
shell: bash
run: |
curl --fail --silent --show-error --header "X-Vault-Token: ${VAULT_TOKEN}" --data "" "${VAULT_SERVER}/v1/auth/token/revoke-self"
curl --fail --silent --show-error --header "X-Vault-Token: ${VAULT_TOKEN}" --data "" "${VAULT_SERVER%/}/v1/auth/token/revoke-self"
env:
VAULT_SERVER: ${{ inputs.vault_server }}
VAULT_TOKEN: ${{ steps.vault_auth.outputs.vault_token }}
2 changes: 1 addition & 1 deletion generate-and-sign
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd "$workdir"
ssh-keygen -q -t ed25519 -N '' -f "./${keyfile}"
pubkey=$(cat "$pubfile")

vault_server_url="${VAULT_SERVER}/v1/${SSH_BACKEND}/sign/${SSH_ROLE}"
vault_server_url="${VAULT_SERVER%/}/v1/${SSH_BACKEND}/sign/${SSH_ROLE}"

curl \
--fail \
Expand Down
2 changes: 1 addition & 1 deletion github-vault-auth
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ curl \
--connect-timeout 10 \
--output "$vault_response" \
--data '{"jwt": "'"$github_jwt"'", "role": "'"$ROLE"'"}' \
"${VAULT_SERVER}/v1/auth/${BACKEND}/login"
"${VAULT_SERVER%/}/v1/auth/${BACKEND}/login"

vault_token=$(jq --exit-status --raw-output .auth.client_token "$vault_response")
echo "::add-mask::$vault_token"
Expand Down

0 comments on commit e532d74

Please sign in to comment.