Skip to content

Use @{...} to inject file content in example workflows#511

Merged
ehedlund merged 1 commit intomainfrom
ehedlund/read_file
Apr 27, 2026
Merged

Use @{...} to inject file content in example workflows#511
ehedlund merged 1 commit intomainfrom
ehedlund/read_file

Conversation

@ehedlund
Copy link
Copy Markdown
Collaborator

Use @{...} to inject file content in example workflows, instead of !{...}, which executes shell commands.

Fixes #509.

Also run npm run format on the repo.

@ehedlund ehedlund requested review from a team as code owners April 27, 2026 16:31
@ehedlund ehedlund requested review from ChrisGe4, benw307, cynthialong0-0 and haroonc and removed request for ChrisGe4, benw307, cynthialong0-0 and haroonc April 27, 2026 16:31
@ehedlund ehedlund enabled auto-merge (squash) April 27, 2026 16:35
Copy link
Copy Markdown
Contributor

@galz10 galz10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Scope: Pull Request #511

This PR addresses issue #509 by migrating from !{read_file(...)} to the native @{...} syntax for file content injection in example TOML command definitions. It also streamlines the corresponding GitHub Action workflow files by removing the now-redundant read_file tool from the core tool allowlist and applies repository-wide formatting via npm run format.

Metadata Review

  • PR Title: "Use @{...} to inject file content in example workflows" - Accurate and follows conventions.
  • PR Description: Clearly explains the motivation (security/hardening by avoiding shell execution in templates) and references the correct issue.

Concerns (Action Required)

  • .github/commands/: The PR updates the files in examples/workflows/, but does not update the corresponding command definitions in .github/commands/. The files in .github/commands/ are the actual default commands installed by the action (as defined in action.yml). Leaving these un-updated creates a discrepancy where the action's built-in defaults use a different (and potentially broken, per #509) syntax compared to the examples provided to users. All TOML files in .github/commands/ should be updated to use the @ syntax and the JSON context file where applicable to maintain consistency and resolve the bug for all users, not just those who copy the examples.

  • Inconsistent Context Handling: The examples/ TOML files have been updated to use a unified JSON context (@{.gemini/context.json}), while the .github/commands/ files still rely on individual environment variable injections (e.g., !{echo $TITLE}). While !{echo ...} might work for simple variables, the PR's intent is to move towards the @ syntax. These should be aligned to ensure a consistent developer experience.

@ehedlund ehedlund merged commit 3ca2577 into main Apr 27, 2026
11 checks passed
@ehedlund ehedlund deleted the ehedlund/read_file branch April 27, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Example workflow prompts misuse !{...} for read_file

2 participants