Skip to content

Commit

Permalink
test: Do not leak step env in composite (#1585)
Browse files Browse the repository at this point in the history
* test: Do not leak step env in composite

To prevent merging regressions.

* Update runner_test.go
  • Loading branch information
ChristopherHX authored Jan 29, 2023
1 parent 932863b commit 3748772
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func TestRunEvent(t *testing.T) {
// {"testdata", "issue-228", "push", "", platforms, }, // TODO [igni]: Remove this once everything passes
{"../model/testdata", "container-volumes", "push", "", platforms, secrets},
{workdir, "path-handling", "push", "", platforms, secrets},
{workdir, "do-not-leak-step-env-in-composite", "push", "", platforms, secrets},
}

for _, table := range tables {
Expand Down Expand Up @@ -295,12 +296,14 @@ func TestRunEventHostEnvironment(t *testing.T) {
}...)
} else {
platforms := map[string]string{
"self-hosted": "-self-hosted",
"self-hosted": "-self-hosted",
"ubuntu-latest": "-self-hosted",
}

tables = append(tables, []TestJobFileInfo{
{workdir, "nix-prepend-path", "push", "", platforms, secrets},
{workdir, "inputs-via-env-context", "push", "", platforms, secrets},
{workdir, "do-not-leak-step-env-in-composite", "push", "", platforms, secrets},
}...)
}

Expand Down
17 changes: 17 additions & 0 deletions pkg/runner/testdata/do-not-leak-step-env-in-composite/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on: push
jobs:
_:
runs-on: ubuntu-latest
steps:
- run: |
runs:
using: composite
steps:
- run: exit 1
if: env.LEAK_ENV != 'val'
shell: cp {0} action.yml
- uses: ./
env:
LEAK_ENV: val
- run: exit 1
if: env.LEAK_ENV == 'val'

0 comments on commit 3748772

Please sign in to comment.