Skip to content

Conversation

@nathro
Copy link
Collaborator

@nathro nathro commented Sep 18, 2025

Add support for rules and MCP configs to the GitHub Action

  • Add new optional inputs rules and mcp_configs in action.yml; each expects a JSON array of file paths
  • Forward each rules path to auggie as --rules <path> and each MCP config path as --mcp-config <path>
  • Validate and parse these inputs via Zod: accept JSON strings from GitHub inputs, ensure entries are non-empty strings
  • Extend ActionInputs and INPUT_FIELD_MAP to include rules and mcpConfigs
  • Fix instruction flag handling in CLI arg construction by pushing the flag and its value together (prevents ordering issues)
  • Update README with usage, examples, and documentation of the new inputs

Why

  • Enables policy-aware runs by passing rule files and MCP configuration directly through the action without custom wrappers
  • Improves reliability of CLI argument construction for instruction sources

Compatibility

  • Backward compatible; existing workflows continue to work without changes

Examples

  • rules: '[".github/augment/rules.md"]'
  • mcp_configs: '[".augment/mcp/config.json"]'

🤖 This description was generated automatically. Please react with 👍 if it's helpful or 👎 if it needs improvement.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Solid addition of rules and MCP config support, and the instruction flag handling fix looks good. I left one small, high‑confidence suggestion to improve observability. Also, consider adding unit tests that cover the new inputs’ validation and CLI argument forwarding paths.


🤖 Automated review complete. Please react with 👍 or 👎 on the individual review comments to provide feedback on their usefulness.

src/index.ts Outdated
}
args.push(instruction_value);

if (inputs.rules?.length) {

Choose a reason for hiding this comment

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

Minor observability suggestion: it could help troubleshooting to log how many rules and MCP config paths were provided before invoking auggie, and optionally de‑duplicate the arrays to avoid passing duplicate flags. For example:

Current code:

if (inputs.rules?.length) {
  for (const rulePath of inputs.rules) {
    args.push('--rules', rulePath);
  }
}

if (inputs.mcpConfigs?.length) {
  for (const configPath of inputs.mcpConfigs) {
    args.push('--mcp-config', configPath);
  }
}

Suggested improvement:

const uniqueRules = Array.from(new Set(inputs.rules ?? []));
const uniqueMcp = Array.from(new Set(inputs.mcpConfigs ?? []));
if (uniqueRules.length) {
  logger.info(`🔧 Applying ${uniqueRules.length} rule file(s)`);
  for (const rulePath of uniqueRules) args.push('--rules', rulePath);
}
if (uniqueMcp.length) {
  logger.info(`🧩 Applying ${uniqueMcp.length} MCP config file(s)`);
  for (const cfg of uniqueMcp) args.push('--mcp-config', cfg);
}

Copy link

@augment-app-staging augment-app-staging bot left a comment

Choose a reason for hiding this comment

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

The additions for rules and mcp_configs are threaded end-to-end (action inputs, env wiring, validation, and CLI flags) and the argument construction for instructions has been corrected. Validation behavior for JSON array inputs looks robust, including empty and malformed cases. Review completed. No suggestions at this time.

@nathro nathro merged commit 0d27728 into main Sep 22, 2025
2 checks passed
@nathro nathro deleted the feat/add_rules_and_mcp branch September 22, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants