update
This commit is contained in:
parent
0b36a68d06
commit
bcebea6713
@ -48,19 +48,16 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${{ inputs.secrets }}" | while IFS='>' read -r SECRET_ID ENV_VAR; do
|
echo "${{ inputs.secrets }}" | while IFS='>' read -r SECRET_ID ENV_VAR; do
|
||||||
# Trim whitespace
|
|
||||||
SECRET_ID=$(echo "$SECRET_ID" | xargs)
|
SECRET_ID=$(echo "$SECRET_ID" | xargs)
|
||||||
ENV_VAR=$(echo "$ENV_VAR" | xargs)
|
ENV_VAR=$(echo "$ENV_VAR" | xargs)
|
||||||
|
|
||||||
# Validate input format
|
# Skip empty or invalid lines
|
||||||
if [[ -z "$SECRET_ID" || -z "$ENV_VAR" ]]; then
|
if [[ -z "$SECRET_ID" || -z "$ENV_VAR" ]]; then
|
||||||
echo "❌ Invalid secret pair format: $SECRET_ID > $ENV_VAR"
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🔍 Retrieving secret: $SECRET_ID..."
|
echo "🔍 Retrieving secret: $SECRET_ID..."
|
||||||
|
|
||||||
# Fetch secret from Bitwarden
|
|
||||||
SECRET_VALUE=$(bw get notes "$SECRET_ID" --session "$BW_SESSION" 2>/dev/null)
|
SECRET_VALUE=$(bw get notes "$SECRET_ID" --session "$BW_SESSION" 2>/dev/null)
|
||||||
|
|
||||||
if [[ -n "$SECRET_VALUE" ]]; then
|
if [[ -n "$SECRET_VALUE" ]]; then
|
||||||
@ -70,3 +67,5 @@ runs:
|
|||||||
echo "❌ Failed to retrieve secret: $SECRET_ID"
|
echo "❌ Failed to retrieve secret: $SECRET_ID"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user