Commit a473a51
authored
fix: Make action paths compatible with both GitHub-hosted and self-hosted runners (#76)
Follow-up to #59
(which explains why copy steps and relative paths are used)
Fixes #71
Instead of assuming actions can be copied to `/home/runner/work` (a path
which does not exist on some self-hosted runners), this PR uses
`$GITHUB_WORKSPACE/../..` (i.e. the directory above the workflow’s repo
and owner directories, aka `$RUNNER_TEMP/..`). That _is_
`/home/runner/work` on GitHub-hosted runners, but it might be
`/actions-runner/_work` or `/home/runner/_work` (etc.) on self-hosted
runners.
Additionally, this PR uses `cp` in place of `rsync`, since the latter is
not installed on some self-hosted runners. It adds an `rsync`-like guard
to avoid (errors due to) copying a file over itself.
I tested this branch’s:
- Top-level scanner action on a self-hosted runner:
https://github.com/github/accessibility-sandbox/actions/runs/19862994002
(Hubber access only) (this run failed, but for reasons unrelated to
paths)
- Top-level scanner action on a GitHub-hosted runner:
https://github.com/github/accessibility-sandbox/actions/runs/19863037045
(Hubber access only)
- Nested `gh-cache/*` actions on a self-hosted runner:
https://github.com/github/accessibility-sandbox/actions/runs/19863906871
(Hubber access only)
- Nested `gh-cache/*` actions on a GitHub-hosted runner:
https://github.com/github/accessibility-sandbox/actions/runs/19863535680
(Hubber access only)2 files changed
+20
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | | - | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | | - | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
82 | | - | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
99 | | - | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
129 | | - | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
0 commit comments