Skip to content

Commit a53a1c2

Browse files
ChristopherHXKnisterPetermergify[bot]
authored
fix: extra path lost in composite actions (#1531)
* test: define test case of path issues Test case for #1528 * test: add multi arch grep * fix: Always use current ExtraPath * replace setup-node with run step * Update push.yml * yaml mistake Co-authored-by: Markus Wolf <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 3f4a6dc commit a53a1c2

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

pkg/runner/runner_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func TestRunEvent(t *testing.T) {
201201
{"../model/testdata", "strategy", "push", "", platforms, secrets}, // TODO: move all testdata into pkg so we can validate it with planner and runner
202202
// {"testdata", "issue-228", "push", "", platforms, }, // TODO [igni]: Remove this once everything passes
203203
{"../model/testdata", "container-volumes", "push", "", platforms, secrets},
204+
{workdir, "path-handling", "push", "", platforms, secrets},
204205
}
205206

206207
for _, table := range tables {

pkg/runner/step_action_remote.go

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ func (sar *stepActionRemote) getCompositeRunContext(ctx context.Context) *RunCon
196196
// was already created during the pre stage)
197197
env := evaluateCompositeInputAndEnv(ctx, sar.RunContext, sar)
198198
sar.compositeRunContext.Env = env
199+
sar.compositeRunContext.ExtraPath = sar.RunContext.ExtraPath
199200
}
200201
return sar.compositeRunContext
201202
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: output action
2+
description: output action
3+
4+
inputs:
5+
input:
6+
description: some input
7+
required: false
8+
9+
outputs:
10+
job-output:
11+
description: some output
12+
value: ${{ steps.gen-out.outputs.step-output }}
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- name: run step
18+
id: gen-out
19+
run: |
20+
echo "::set-output name=step-output::"
21+
shell: bash
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: path tests
2+
on: push
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
9+
- name: "Append to $GITHUB_PATH"
10+
run: |
11+
echo "/opt/hostedtoolcache/node/18.99/x64/bin" >> $GITHUB_PATH
12+
13+
- name: test path (after setup)
14+
run: |
15+
if ! echo "$PATH" |grep "/opt/hostedtoolcache/node/18.*/\(x64\|arm64\)/bin" ; then
16+
echo "Node binaries not in path: $PATH"
17+
exit 1
18+
fi
19+
20+
- id: action-with-output
21+
uses: ./path-handling/
22+
23+
- name: test path (after local action)
24+
run: |
25+
if ! echo "$PATH" |grep "/opt/hostedtoolcache/node/18.*/\(x64\|arm64\)/bin" ; then
26+
echo "Node binaries not in path: $PATH"
27+
exit 1
28+
fi
29+
30+
- uses: nektos/act-test-actions/composite@main
31+
with:
32+
input: some input
33+
34+
- name: test path (after remote action)
35+
run: |
36+
if ! echo "$PATH" |grep "/opt/hostedtoolcache/node/18.*/\(x64\|arm64\)/bin" ; then
37+
echo "Node binaries not in path: $PATH"
38+
exit 1
39+
fi

0 commit comments

Comments
 (0)