Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 3 additions & 22 deletions .github/workflows/artifacts-summary.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 4 additions & 27 deletions .github/workflows/audit-workflows.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 3 additions & 22 deletions .github/workflows/daily-choice-test.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 22 additions & 9 deletions actions/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ This action copies workflow script files to the agent environment.

## Description

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.
This action runs in all workflow jobs to provide scripts that can be used instead of being inlined in the workflow. This includes scripts for activation jobs, agent jobs, and safe-output jobs.

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.
The action copies:
- 117 `.cjs` JavaScript files from the `js/` directory
- 6 `.sh` shell scripts from the `sh/` directory

All files are copied to the destination directory (default: `/tmp/gh-aw/actions`). These files are generated by running `make actions-build` and are committed to the repository.

## Usage

Expand All @@ -31,7 +35,7 @@ Default: `/tmp/gh-aw/actions`

### `files-copied`

The number of files copied to the destination directory (should be 117).
The number of files copied to the destination directory (should be 123: 117 JavaScript files + 6 shell scripts).

## Example

Expand All @@ -50,25 +54,34 @@ steps:

## Files Included

This action copies 117 `.cjs` files from `actions/setup/js/`, including:
This action copies files from `actions/setup/`, including:

### JavaScript Files (117 files from `js/`)
- Activation job scripts (check_stop_time, check_skip_if_match, check_command_position, etc.)
- Agent job scripts (compute_text, create_issue, create_pull_request, etc.)
- Safe output scripts (safe_outputs_*, safe_inputs_*, messages, etc.)
- Utility scripts (sanitize_*, validate_*, generate_*, etc.)

All files are copied from the committed `js/` directory which is populated by running `make actions-build` during development.
### Shell Scripts (6 files from `sh/`)
- `create_gh_aw_tmp_dir.sh` - Creates temporary directory structure
- `start_safe_inputs_server.sh` - Starts safe-inputs HTTP server
- `print_prompt_summary.sh` - Prints prompt summary to logs
- `generate_git_patch.sh` - Generates git patches
- `create_cache_memory_dir.sh` - Creates cache-memory directory
- `create_prompt_first.sh` - Creates prompt directory

All files are copied from the committed `js/` and `sh/` directories which are populated by running `make actions-build` during development.

## Development

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.
The `js/` and `sh/` directories contain generated 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.

To update the JavaScript files after modifying source files in `pkg/workflow/js/`:
To update the files after modifying source files in `pkg/workflow/js/` or `pkg/workflow/sh/`:

```bash
make actions-build
git add actions/setup/js/
git commit -m "Update action JavaScript files"
git add actions/setup/js/ actions/setup/sh/
git commit -m "Update action files"
```

## Testing Locally
Expand Down
17 changes: 17 additions & 0 deletions actions/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ for file in "${JS_SOURCE_DIR}"/*.json; do
fi
done

# Copy shell scripts from sh/ directory with executable permissions
SH_SOURCE_DIR="${SCRIPT_DIR}/sh"
if [ -d "${SH_SOURCE_DIR}" ]; then
echo "::debug::Found shell scripts directory: ${SH_SOURCE_DIR}"
for file in "${SH_SOURCE_DIR}"/*.sh; do
if [ -f "$file" ]; then
filename=$(basename "$file")
cp "$file" "${DESTINATION}/${filename}"
chmod +x "${DESTINATION}/${filename}"
echo "::notice::Copied shell script: ${filename}"
FILE_COUNT=$((FILE_COUNT + 1))
fi
done
else
echo "::debug::No shell scripts directory found at ${SH_SOURCE_DIR}"
fi

echo "::notice::Successfully copied ${FILE_COUNT} files to ${DESTINATION}"

# Set output
Expand Down
4 changes: 4 additions & 0 deletions actions/setup/sh/create_cache_memory_dir.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mkdir -p /tmp/gh-aw/cache-memory
echo "Cache memory directory created at /tmp/gh-aw/cache-memory"
echo "This folder provides persistent file storage across workflow runs"
echo "LLMs and agentic tools can freely read and write files in this directory"
3 changes: 3 additions & 0 deletions actions/setup/sh/create_gh_aw_tmp_dir.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdir -p /tmp/gh-aw/agent
mkdir -p /tmp/gh-aw/sandbox/agent/logs
echo "Created /tmp/gh-aw/agent directory for agentic workflow temporary files"
2 changes: 2 additions & 0 deletions actions/setup/sh/create_prompt_first.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PROMPT_DIR="$(dirname "$GH_AW_PROMPT")"
mkdir -p "$PROMPT_DIR"
Loading
Loading