-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mapping
workflow_dispatch
inputs into the Expression inputs
conte…
…xt (#1363) * test: check workflow_dispatch inputs This implements a test to check for `workflow_dispatch` inputs. This will be a prerequisite for implementing the inputs. * feat: map workflow_dispatch input to expression evaluator This changes adds the workflow_dispatch event inputs to the `inputs` context and maintaining the boolean type * fix: coerce boolean input types * fix: use step env if available, rc env otherwise
- Loading branch information
1 parent
5d2eb1f
commit 1e0ef8c
Showing
5 changed files
with
136 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"inputs": { | ||
"required": "required input", | ||
"boolean": "true" | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
pkg/runner/testdata/workflow_dispatch/workflow_dispatch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: workflow_dispatch | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
required: | ||
description: a required input | ||
required: true | ||
with_default: | ||
description: an input with default | ||
required: false | ||
default: default | ||
boolean: | ||
description: an input of type boolean | ||
required: false | ||
type: boolean | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: test required input | ||
run: | | ||
echo input.required=${{ inputs.required }} | ||
[[ "${{ inputs.required }}" = "required input" ]] || exit 1 | ||
- name: test input with default | ||
run: | | ||
echo input.with_default=${{ inputs.with_default }} | ||
[[ "${{ inputs.with_default }}" = "default" ]] || exit 1 | ||
- id: boolean-test | ||
name: run on boolean input | ||
if: ${{ inputs.boolean == true }} | ||
run: echo "::set-output name=value::executed" | ||
- name: has boolean test? | ||
run: | | ||
[[ "${{ steps.boolean-test.outputs.value }}" = "executed" ]] || exit 1 |