You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: actions/setup/README.md
+42-14Lines changed: 42 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,17 @@ This action copies workflow script files to the agent environment.
6
6
7
7
This action runs in all workflow jobs to provide JavaScript scripts that can be required instead of being inlined in the workflow. This includes scripts for activation jobs, agent jobs, and safe-output jobs.
8
8
9
+
The action copies 117 `.cjs` JavaScript files from the `js/` directory to a destination directory (default: `/tmp/gh-aw/actions`). These files are generated by running `make actions-build` and are committed to the repository.
10
+
9
11
## Usage
10
12
11
13
```yaml
12
14
- name: Setup Scripts
13
15
uses: ./actions/setup
14
16
with:
15
17
# Destination directory for script files
16
-
# Default: /tmp/gh-aw/actions/activation
17
-
destination: /tmp/gh-aw/actions/activation
18
+
# Default: /tmp/gh-aw/actions
19
+
destination: /tmp/gh-aw/actions
18
20
```
19
21
20
22
## Inputs
@@ -23,35 +25,61 @@ This action runs in all workflow jobs to provide JavaScript scripts that can be
23
25
24
26
**Optional** Destination directory for script files.
25
27
26
-
Default: `/tmp/gh-aw/actions/activation`
28
+
Default: `/tmp/gh-aw/actions`
27
29
28
30
## Outputs
29
31
30
32
### `files-copied`
31
33
32
-
The number of files copied to the destination directory.
34
+
The number of files copied to the destination directory (should be 117).
33
35
34
36
## Example
35
37
36
38
```yaml
37
39
steps:
38
40
- uses: actions/checkout@v4
41
+
with:
42
+
sparse-checkout: |
43
+
actions
39
44
40
45
- name: Setup Scripts
41
46
uses: ./actions/setup
42
47
with:
43
-
destination: /tmp/gh-aw/actions/activation
48
+
destination: /tmp/gh-aw/actions
44
49
```
45
50
46
51
## Files Included
47
52
48
-
This action copies all .cjs files from the script registry, including:
53
+
This action copies 117 `.cjs` files from `actions/setup/js/`, including:
All files are copied from the committed `js/` directory which is populated by running `make actions-build` during development.
61
+
62
+
## Development
63
+
64
+
The `js/` directory contains generated JavaScript files created by `make actions-build`. These files are committed to the repository so that workflows using sparse checkout can access them without needing to rebuild.
65
+
66
+
To update the JavaScript files after modifying source files in `pkg/workflow/js/`:
67
+
68
+
```bash
69
+
make actions-build
70
+
git add actions/setup/js/
71
+
git commit -m "Update action JavaScript files"
72
+
```
73
+
74
+
## Testing Locally
75
+
76
+
You can test this action locally using the provided test script:
0 commit comments