Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extra path lost in composite actions #1531

Merged
merged 7 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func TestRunEvent(t *testing.T) {
{"../model/testdata", "strategy", "push", "", platforms, secrets}, // TODO: move all testdata into pkg so we can validate it with planner and runner
// {"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},
}

for _, table := range tables {
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/step_action_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func (sar *stepActionRemote) getCompositeRunContext(ctx context.Context) *RunCon
// was already created during the pre stage)
env := evaluateCompositeInputAndEnv(ctx, sar.RunContext, sar)
sar.compositeRunContext.Env = env
sar.compositeRunContext.ExtraPath = sar.RunContext.ExtraPath
}
return sar.compositeRunContext
}
Expand Down
21 changes: 21 additions & 0 deletions pkg/runner/testdata/path-handling/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: output action
description: output action

inputs:
input:
description: some input
required: false

outputs:
job-output:
description: some output
value: ${{ steps.gen-out.outputs.step-output }}

runs:
using: composite
steps:
- name: run step
id: gen-out
run: |
echo "::set-output name=step-output::"
shell: bash
39 changes: 39 additions & 0 deletions pkg/runner/testdata/path-handling/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: path tests
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: "Append to $GITHUB_PATH"
run: |
echo "/opt/hostedtoolcache/node/18.99/x64/bin" >> $GITHUB_PATH

- name: test path (after setup)
run: |
if ! echo "$PATH" |grep "/opt/hostedtoolcache/node/18.*/\(x64\|arm64\)/bin" ; then
echo "Node binaries not in path: $PATH"
exit 1
fi

- id: action-with-output
uses: ./path-handling/

- name: test path (after local action)
run: |
if ! echo "$PATH" |grep "/opt/hostedtoolcache/node/18.*/\(x64\|arm64\)/bin" ; then
echo "Node binaries not in path: $PATH"
exit 1
fi

- uses: nektos/act-test-actions/composite@main
with:
input: some input

- name: test path (after remote action)
run: |
if ! echo "$PATH" |grep "/opt/hostedtoolcache/node/18.*/\(x64\|arm64\)/bin" ; then
echo "Node binaries not in path: $PATH"
exit 1
fi