Add env input to workflows
This commit is contained in:
19
.github/workflows/node-ci.yml
vendored
19
.github/workflows/node-ci.yml
vendored
@@ -15,6 +15,12 @@ on:
|
|||||||
cache_dependency_path:
|
cache_dependency_path:
|
||||||
type: string
|
type: string
|
||||||
default: "pnpm-lock.yaml"
|
default: "pnpm-lock.yaml"
|
||||||
|
env:
|
||||||
|
description: >
|
||||||
|
Multiline env vars, one per line: KEY=VALUE
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
format_command:
|
format_command:
|
||||||
type: string
|
type: string
|
||||||
default: "pnpm format:check"
|
default: "pnpm format:check"
|
||||||
@@ -42,6 +48,19 @@ jobs:
|
|||||||
- name: Checkout source
|
- name: Checkout source
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Start ssh-agent
|
||||||
if: ${{ secrets.ssh_private_key != '' }}
|
if: ${{ secrets.ssh_private_key != '' }}
|
||||||
uses: webfactory/ssh-agent@v0.9.0
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
|
|||||||
19
.github/workflows/python-uv-ci.yml
vendored
19
.github/workflows/python-uv-ci.yml
vendored
@@ -15,6 +15,12 @@ on:
|
|||||||
cache_dependency_path:
|
cache_dependency_path:
|
||||||
type: string
|
type: string
|
||||||
default: "uv.lock"
|
default: "uv.lock"
|
||||||
|
env:
|
||||||
|
description: >
|
||||||
|
Multiline env vars, one per line: KEY=VALUE
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
uv_sync_args:
|
uv_sync_args:
|
||||||
type: string
|
type: string
|
||||||
default: "--frozen --dev"
|
default: "--frozen --dev"
|
||||||
@@ -48,6 +54,19 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Start ssh-agent
|
||||||
if: ${{ secrets.ssh_private_key != '' }}
|
if: ${{ secrets.ssh_private_key != '' }}
|
||||||
uses: webfactory/ssh-agent@v0.9.0
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
|
|||||||
Reference in New Issue
Block a user