fix/stop-showing-secrets #6
+5
-9
@@ -33,19 +33,15 @@ runs:
|
|||||||
shell: sh
|
shell: sh
|
||||||
run: bw config server "${{ inputs.server }}"
|
run: bw config server "${{ inputs.server }}"
|
||||||
|
|
||||||
- name: Unlock Vault
|
- name: Unlock vault and retrieve secrets
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
|
||||||
bw login --apikey
|
|
||||||
BW_SESSION=$(bw unlock '${{ inputs.password }}' --raw)
|
|
||||||
echo "BW_SESSION=$BW_SESSION" >> $GITHUB_ENV
|
|
||||||
env:
|
env:
|
||||||
BW_CLIENTID: "${{ inputs.client-id }}"
|
BW_CLIENTID: "${{ inputs.client-id }}"
|
||||||
BW_CLIENTSECRET: "${{ inputs.client-secret }}"
|
BW_CLIENTSECRET: "${{ inputs.client-secret }}"
|
||||||
|
|
||||||
- name: Retrieve Secrets
|
|
||||||
shell: sh
|
|
||||||
run: |
|
run: |
|
||||||
|
bw login --apikey
|
||||||
|
BW_SESSION=$(bw unlock '${{ inputs.password }}' --raw)
|
||||||
|
|
||||||
echo "${{ inputs.secrets }}" | while IFS='>' read SECRET_ID ENV_VAR; do
|
echo "${{ inputs.secrets }}" | while IFS='>' read SECRET_ID ENV_VAR; do
|
||||||
SECRET_ID=$(echo "$SECRET_ID" | sed 's/^ *//;s/ *$//')
|
SECRET_ID=$(echo "$SECRET_ID" | sed 's/^ *//;s/ *$//')
|
||||||
ENV_VAR=$(echo "$ENV_VAR" | sed 's/^ *//;s/ *$//')
|
ENV_VAR=$(echo "$ENV_VAR" | sed 's/^ *//;s/ *$//')
|
||||||
@@ -54,7 +50,7 @@ runs:
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🔍 Retrieving secret"
|
echo "🔍 Retrieving secret: $SECRET_ID"
|
||||||
SECRET_VALUE=$(bw get notes "$SECRET_ID" --session "$BW_SESSION" --raw 2>/dev/null)
|
SECRET_VALUE=$(bw get notes "$SECRET_ID" --session "$BW_SESSION" --raw 2>/dev/null)
|
||||||
|
|
||||||
if [ -n "$SECRET_VALUE" ]; then
|
if [ -n "$SECRET_VALUE" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user