Add readme #2

Merged
jamie merged 2 commits from readme into main 2026-04-15 12:41:11 +00:00
Showing only changes of commit e39e5362c4 - Show all commits
+11
View File
@@ -19,6 +19,10 @@ inputs:
secrets: secrets:
description: "List of secret IDs and corresponding environment variable names (format: 'SECRET_ID > ENV_VAR')" description: "List of secret IDs and corresponding environment variable names (format: 'SECRET_ID > ENV_VAR')"
required: true required: true
dot-env-path:
description: "Path to write the DOT_ENV secret to instead of exporting it via GITHUB_ENV"
required: false
default: ""
runs: runs:
using: "composite" using: "composite"
@@ -52,10 +56,17 @@ runs:
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
if [ "$ENV_VAR" = "DOT_ENV" ] && [ -n "${{ inputs.dot-env-path }}" ]; then
mkdir -p "$(dirname "${{ inputs.dot-env-path }}")"
umask 077
printf '%s\n' "$SECRET_VALUE" > "${{ inputs.dot-env-path }}"
echo "Stored $SECRET_ID in $ENV_VAR file"
else
echo "$ENV_VAR<<EOF" >> $GITHUB_ENV echo "$ENV_VAR<<EOF" >> $GITHUB_ENV
echo "$SECRET_VALUE" >> $GITHUB_ENV echo "$SECRET_VALUE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV
echo "Stored $SECRET_ID in $ENV_VAR" echo "Stored $SECRET_ID in $ENV_VAR"
fi
else else
echo "Failed to retrieve secret: $SECRET_ID" echo "Failed to retrieve secret: $SECRET_ID"
fi fi