Conversation
…nstructions - Enhanced error message when path not found in staging directory to list available files or indicate the directory is empty, helping diagnose whether the agent forgot to copy files or used the wrong path - Updated api-consumption-report.md Step 5 with explicit shell commands for staging chart files and correct path format guidance - Addresses 3 consecutive daily failures (runs 6-8) caused by the AI agent not copying charts to the staging directory before calling upload_artifact Agent-Logs-Url: https://github.com/github/gh-aw/sessions/3240af67-1ba1-4b22-91cf-a5b20c589d5b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
April 11, 2026 11:02
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Improves diagnostics and workflow documentation for upload_artifact to prevent/triage failures when expected files aren’t staged into the safe-outputs upload directory.
Changes:
- Enhance
upload_artifactmissing-path errors to include staged file listings (or an “empty staging dir” hint). - Update
api-consumption-reportworkflow instructions to explicitlycpchart PNGs into the staging directory and verify withls. - Clarify that artifact uploads should reference staged filenames (not
charts/...paths) for this workflow.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/upload_artifact.cjs | Adds richer error hints (available staged files / empty staging directory guidance) when a requested path is missing. |
| .github/workflows/api-consumption-report.md | Rewrites Step 5 with explicit staging + verification commands and clearer path usage guidance. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
+145
to
+149
| const available = listFilesRecursive(STAGING_DIR, STAGING_DIR); | ||
| const hint = | ||
| available.length > 0 | ||
| ? ` Available files: [${available.slice(0, 20).join(", ")}]${available.length > 20 ? ` … and ${available.length - 20} more` : ""}` | ||
| : " The staging directory is empty — did you forget to copy files to " + STAGING_DIR + "?"; |
There was a problem hiding this comment.
The hint branch treats a missing staging directory the same as an empty one: listFilesRecursive() returns [] when STAGING_DIR doesn’t exist, so the message says “The staging directory is empty …” even though the directory may be missing. Consider checking fs.existsSync(STAGING_DIR) separately and using a more accurate hint (e.g., distinguish “does not exist” vs “is empty”).
Suggested change
| const available = listFilesRecursive(STAGING_DIR, STAGING_DIR); | |
| const hint = | |
| available.length > 0 | |
| ? ` Available files: [${available.slice(0, 20).join(", ")}]${available.length > 20 ? ` … and ${available.length - 20} more` : ""}` | |
| : " The staging directory is empty — did you forget to copy files to " + STAGING_DIR + "?"; | |
| const stagingDirExists = fs.existsSync(STAGING_DIR); | |
| const available = stagingDirExists ? listFilesRecursive(STAGING_DIR, STAGING_DIR) : []; | |
| const hint = | |
| available.length > 0 | |
| ? ` Available files: [${available.slice(0, 20).join(", ")}]${available.length > 20 ? ` … and ${available.length - 20} more` : ""}` | |
| : stagingDirExists | |
| ? " The staging directory is empty — did you forget to copy files to " + STAGING_DIR + "?" | |
| : " The staging directory does not exist — did you forget to create or populate " + STAGING_DIR + "?"; |
This was referenced Apr 11, 2026
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
api-consumption-reportworkflow failed 3 consecutive days (runs 6–8) because the AI agent never copies generated charts to the staging directory before callingupload_artifact. The error message provided no hint about what went wrong — just "path does not exist."Changes
actions/setup/js/upload_artifact.cjs— When a requested path doesn't exist in the staging directory, the error now lists available files (or states the directory is empty):.github/workflows/api-consumption-report.md(Step 5) — Replaced vague "stage each chart" instruction with explicitcpcommands, a verification step, and guidance to use flat filenames (not subdirectory paths likecharts/api_calls_trend.png)