Test: env.ACT in if condition of the workflow (#965)
Co-authored-by: Mathijs van Veluw <BlackDex@users.noreply.github.com> Co-authored-by: Mathijs van Veluw <BlackDex@users.noreply.github.com>
This commit is contained in:
parent
2eda7c6037
commit
3f0375aeff
@ -125,6 +125,7 @@ func TestRunEvent(t *testing.T) {
|
|||||||
{"testdata", "composite-fail-with-output", "push", "", platforms, ""},
|
{"testdata", "composite-fail-with-output", "push", "", platforms, ""},
|
||||||
{"testdata", "issue-597", "push", "", platforms, ""},
|
{"testdata", "issue-597", "push", "", platforms, ""},
|
||||||
{"testdata", "issue-598", "push", "", platforms, ""},
|
{"testdata", "issue-598", "push", "", platforms, ""},
|
||||||
|
{"testdata", "if-env-act", "push", "", platforms, ""},
|
||||||
{"testdata", "env-and-path", "push", "", platforms, ""},
|
{"testdata", "env-and-path", "push", "", platforms, ""},
|
||||||
{"testdata", "outputs", "push", "", platforms, ""},
|
{"testdata", "outputs", "push", "", platforms, ""},
|
||||||
{"testdata", "steps-context/conclusion", "push", "", platforms, ""},
|
{"testdata", "steps-context/conclusion", "push", "", platforms, ""},
|
||||||
|
25
pkg/runner/testdata/if-env-act/push.yml
vendored
Normal file
25
pkg/runner/testdata/if-env-act/push.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: if-env-act-test
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
if_env_test:
|
||||||
|
name: Test if env.ACT matching
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Should RUN, since we are running in act
|
||||||
|
- name: Positive env.ACT match
|
||||||
|
if: ${{ env.ACT }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "This workflow is run using act, continue!"
|
||||||
|
echo "ACT: $ACT"
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Should SKIP, since we are running in act
|
||||||
|
- name: Negative env.ACT match
|
||||||
|
if: ${{ !env.ACT }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "This should be skipped since this workflow is run using act, fail!"
|
||||||
|
echo "ACT: $ACT"
|
||||||
|
exit 1
|
Loading…
Reference in New Issue
Block a user