-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: expose file download feature outside of tag mode #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: expose file download feature outside of tag mode #492
Conversation
Found some issue in the example workflow fileThe IssueThe implementation sets How I TestedCreated a test workflow to verify environment variable persistence between steps:
Test run: https://github.com/km-anthropic/claude-code-action/actions/runs/17262284603 Test OutputThe Problem CodeIn process.env.CLAUDE_ASSET_FILES = downloadedPaths.join(",");This only sets the variable for the current process, not for subsequent workflow steps. The FixReplace line 144 with one of these options: Option 1: Use GitHub Actions core (recommended) core.exportVariable('CLAUDE_ASSET_FILES', downloadedPaths.join(','));Option 2: Write to GITHUB_ENV file const githubEnvFile = process.env.GITHUB_ENV;
if (githubEnvFile) {
require('fs').appendFileSync(
githubEnvFile,
`CLAUDE_ASSET_FILES=${downloadedPaths.join(",")}\n`
);
}ImpactWithout this fix:
The asset downloading itself works correctly - the issue is only with making the paths available to subsequent steps. Test Workflow UsedYou can see the test workflow here: https://github.com/km-anthropic/claude-code-action/blob/main/.github/workflows/test-asset-env.yml cc @atsushi-ishibashi - this needs to be fixed before merging, as the feature won't work as documented without this change. |
|
@km-anthropic Fixed with Option1👍️ |
|
Thanks! Can you update usage.md too! then we should be good to go |
|
@km-anthropic |
Yeah I think that's fine, ideally a simpler and cleaner example would be great if you can do it. |
|
@km-anthropic |
action.yml
Outdated
| download_github_assets: | ||
| description: "Download GitHub assets (images, attachments) for access via environment variables" | ||
| required: false | ||
| default: "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be an input? Feels like we can do it by default without much issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashwin-ant
Since file download overhead could affect GitHub Actions runtime, I added an input to disable file downloads by default in agent mode. That said, I think it would also be fine to perform downloads by default. (If it seems possible to speed up the download process, I might try that in a separate PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to just make it happen automatically given that most issues and PRs don't have images anyway. We can add an opt-out later if it becomes necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While writing usage.md, I also felt that it’s somewhat confusing that this input only works in agent mode, whereas in tag mode downloads occur regardless of its value. Moreover, since the mode is now auto-detected, this distinction seems even less clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to just make it happen automatically given that most issues and PRs don't have images anyway. We can add an opt-out later if it becomes necessary.
Sure👍️ I'll remove the input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashwin-ant resolved!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me! Can you please update the docs, usage.md in specific?
@km-anthropic |
|
Any update? |
This PR implements the feature requested in #426 to make GitHub asset download functionality available outside of Tag Mode.
Changes:
download_github_assets(default:false) toaction.ymlCLAUDE_ASSET_FILESas comma-separated valuesissue_comment,pull_request, etc.), not automation eventsUsage:
Files changed:
action.yml- Added new input parametersrc/modes/agent/index.ts- Implemented download functionalityexamples/agent-with-assets.yml- Added usage example with shell expansiontest/modes/agent.test.ts- Added comprehensive testsThis enables Agent Mode workflows to access and analyze GitHub attachments (screenshots, diagrams, etc.) that were previously only available in Tag Mode.