45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
name: Conditional Variables
|
|
|
|
description: |
|
|
Evaluates a list of conditions and exposes variables as outputs.
|
|
Conditions are evaluated in order. All matching conditions are applied.
|
|
If multiple conditions set the same variable, the last matching value wins.
|
|
|
|
inputs:
|
|
context:
|
|
description: |
|
|
Context variables available during condition evaluation.
|
|
|
|
conditions:
|
|
description: |
|
|
List of conditions to evaluate.
|
|
|
|
Example:
|
|
|
|
- when:
|
|
branch:
|
|
- 9.0-alpine-24
|
|
- 9.0-alpine-23
|
|
set:
|
|
DOTNET_VERSION: 9.0
|
|
|
|
required: true
|
|
|
|
fail-on-no-match:
|
|
description: |
|
|
Fail the action when no condition matches.
|
|
required: false
|
|
default: "false"
|
|
|
|
runs:
|
|
using: composite
|
|
|
|
steps:
|
|
- name: Evaluate conditions
|
|
shell: bash
|
|
env:
|
|
CONTEXT: ${{ inputs.context }}
|
|
CONDITIONS: ${{ inputs.conditions }}
|
|
FAIL_ON_NO_MATCH: ${{ inputs.fail-on-no-match }}
|
|
run: |
|
|
"${{ github.action_path }}/evaluate.sh" |