diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index c438f63..40646c4 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -15,6 +15,12 @@ on: cache_dependency_path: type: string default: "pnpm-lock.yaml" + env: + description: > + Multiline env vars, one per line: KEY=VALUE + required: false + type: string + default: "" format_command: type: string default: "pnpm format:check" @@ -42,6 +48,19 @@ jobs: - name: Checkout source uses: actions/checkout@v4 + - name: Load env vars + if: ${{ inputs.env != '' }} + run: | + while IFS= read -r line; do + [ -z "$line" ] && continue + case "$line" in \#*) continue;; esac + if [[ "$line" != *=* ]]; then + echo "Invalid env line: $line" >&2 + exit 1 + fi + echo "$line" >> "$GITHUB_ENV" + done <<< "${{ inputs.env }}" + - name: Start ssh-agent if: ${{ secrets.ssh_private_key != '' }} uses: webfactory/ssh-agent@v0.9.0 diff --git a/.github/workflows/python-uv-ci.yml b/.github/workflows/python-uv-ci.yml index e8c1c39..030911e 100644 --- a/.github/workflows/python-uv-ci.yml +++ b/.github/workflows/python-uv-ci.yml @@ -15,6 +15,12 @@ on: cache_dependency_path: type: string default: "uv.lock" + env: + description: > + Multiline env vars, one per line: KEY=VALUE + required: false + type: string + default: "" uv_sync_args: type: string default: "--frozen --dev" @@ -48,6 +54,19 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Load env vars + if: ${{ inputs.env != '' }} + run: | + while IFS= read -r line; do + [ -z "$line" ] && continue + case "$line" in \#*) continue;; esac + if [[ "$line" != *=* ]]; then + echo "Invalid env line: $line" >&2 + exit 1 + fi + echo "$line" >> "$GITHUB_ENV" + done <<< "${{ inputs.env }}" + - name: Start ssh-agent if: ${{ secrets.ssh_private_key != '' }} uses: webfactory/ssh-agent@v0.9.0