fix: ensure /tmp/gh-aw exists before activation job scripts run#19040
Merged
fix: ensure /tmp/gh-aw exists before activation job scripts run#19040
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix metrics collector failing due to missing aw_info.json
fix: ensure /tmp/gh-aw exists before activation job scripts run
Mar 1, 2026
pelikhan
approved these changes
Mar 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures the Metrics Collector activation job doesn’t crash with ENOENT by guaranteeing /tmp/gh-aw exists before any activation scripts attempt to write into it.
Changes:
- Create
/tmp/gh-awduringactions/setup/setup.shinitialization. - Add log output indicating the temp directory was created.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "Created directory: ${DESTINATION}" | ||
|
|
||
| # Create /tmp/gh-aw directory so it exists before any activation scripts run | ||
| mkdir -p /tmp/gh-aw |
There was a problem hiding this comment.
This script already uses create_dir for directory creation (likely centralizing error handling, permissions, logging, and consistent behavior). For consistency and to avoid bypassing any safeguards in create_dir, consider using create_dir \"/tmp/gh-aw\" here (and quoting the path) instead of calling mkdir -p directly.
Suggested change
| mkdir -p /tmp/gh-aw | |
| create_dir "/tmp/gh-aw" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Metrics Collector activation job was crashing with
ENOENT: no such file or directory, open '/tmp/gh-aw/aw_info.json'becausesetup.shnever created/tmp/gh-aw/— only/opt/gh-aw/*paths were guaranteed. Thegenerate_aw_info.cjsmodule has amkdirSyncguard, but that's a secondary safeguard; the directory should exist before any script touches it.Changes
actions/setup/setup.sh: Addmkdir -p /tmp/gh-awimmediately after the main destination directory is created, so the path is guaranteed for all jobs using./actions/setup— including the activation job wherecreate_gh_aw_tmp_dir.shis never called (it runs only in the agent job).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.