Skip to content

Conversation

@justinxu421
Copy link
Contributor

@justinxu421 justinxu421 commented Oct 8, 2025

Replace Bun with Node.js as the runtime for the augment-agent GitHub Action.

Key Changes

  • Runtime: Switch from Bun to Node.js for executing the GitHub Action
  • Build process: Add TypeScript compilation step; compiled JavaScript artifacts (.js, .d.ts, .map files) are now committed to the repository for GitHub Actions compatibility
  • Dependency management: Replace bun.lock with package-lock.json and update engine requirements to specify Node.js ≥22.0.0
  • Scripts: Update all package.json scripts to use npm/node commands instead of bun
  • Action configuration: Remove Bun setup step from action.yml and execute compiled JavaScript instead of TypeScript source
  • Documentation: Update RELEASE.md to reference npm commands throughout

Technical Impact

This change improves compatibility with standard Node.js tooling and GitHub Actions infrastructure. The action now runs pre-compiled JavaScript files, eliminating the need for runtime TypeScript compilation. Workflow files in .github/workflows/ will need separate updates due to OAuth scope limitations.

Testing

  • ✅ TypeScript compilation successful
  • ✅ Format check passes
  • ✅ Type check passes
  • ✅ All scripts updated and tested

https://github.com/augmentcode/augment-agent/actions/runs/18358301146/job/52295888347
image


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

- Update package.json scripts to use npm/node instead of bun
- Change shebang in src/index.ts from bun to node
- Add build script to compile TypeScript to JavaScript
- Update action.yml to run compiled .js files instead of .ts
- Remove bun.lock and add package-lock.json
- Update RELEASE.md documentation to reference npm
- Remove bun engine requirement from package.json
- Include compiled JavaScript files for GitHub Actions execution

Note: Workflow files will be updated in a follow-up commit

Addresses AU-14631
- Add tsx as dev dependency to run TypeScript without compilation
- Update action.yml to use 'npx tsx' instead of 'node'
- Add step to install action dependencies in action.yml
- Remove all compiled .js, .d.ts, .js.map, .d.ts.map files from src/
- Add compiled files to .gitignore
- Remove build script from package.json (no longer needed)

This approach is cleaner as we don't need to commit compiled files.

Note: Workflow files still need to be updated separately due to OAuth scope limitations.
@augmentcode augmentcode deleted a comment from github-actions bot Oct 8, 2025
@justinxu421
Copy link
Contributor Author

augment review

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.

Thanks for the switch to Node.js; overall changes look good. I left a few comments about ensuring the action can resolve tsx at runtime and about TypeScript execution under Node in dev/local contexts. Addressing these should help avoid runtime surprises.

working-directory: ${{ github.action_path }}
- name: Run Augment Agent
run: bun run $GITHUB_ACTION_PATH/src/index.ts
run: npx tsx $GITHUB_ACTION_PATH/src/index.ts

Choose a reason for hiding this comment

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

Since dependencies are installed under ${{ github.action_path }}, npx tsx may not resolve here unless the working directory is set; consider setting working-directory: ${{ github.action_path }} on this step (also applies if relying on local node_modules/.bin).

🤖 React with 👍 or 👎 to let us know if the comment was useful.

"lint": "prettier --check .",
"lint:fix": "prettier --write .",
"dev": "bun --watch src/index.ts",
"dev": "node --watch src/index.ts",

Choose a reason for hiding this comment

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

node won’t execute .ts files by default; this dev script is likely to fail unless relying on experimental flags, so it may not work as intended.

🤖 React with 👍 or 👎 to let us know if the comment was useful.

@justinxu421 justinxu421 marked this pull request as ready for review October 8, 2025 21:16
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.

Thanks for the update to use Node.js. I left a few targeted comments where the new setup may not behave as intended. Overall the direction looks good; these tweaks should help avoid runtime surprises.

working-directory: ${{ github.action_path }}
- name: Run Augment Agent
run: bun run $GITHUB_ACTION_PATH/src/index.ts
run: npx tsx $GITHUB_ACTION_PATH/src/index.ts

Choose a reason for hiding this comment

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

Using npx tsx here without setting the working directory may resolve tsx from the caller repo or trigger a network install, rather than the version installed under ${{ github.action_path }}. Consider running this step with working-directory: ${{ github.action_path }} so the locally installed tsx is used.

🤖 React with 👍 or 👎 to let us know if the comment was useful.

"lint": "prettier --check .",
"lint:fix": "prettier --write .",
"dev": "bun --watch src/index.ts",
"dev": "node --watch src/index.ts",

Choose a reason for hiding this comment

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

The dev script runs node --watch src/index.ts, but Node cannot execute TypeScript files directly without a loader. This will likely fail at runtime; consider using a TS-aware runner (e.g., tsx --watch) for local development.

🤖 React with 👍 or 👎 to let us know if the comment was useful.

@@ -1,4 +1,4 @@
#!/usr/bin/env bun
#!/usr/bin/env node

Choose a reason for hiding this comment

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

A Node shebang on a TypeScript file is misleading because node cannot execute TS without a loader. If this file isn’t executed directly, consider removing the shebang to avoid confusion.

🤖 React with 👍 or 👎 to let us know if the comment was useful.

@nathro
Copy link
Collaborator

nathro commented Oct 8, 2025

Can we test something calling this sha from a separate repo. I've seen weirdness crop up from the directory structure that comes when an action is used from a separate repo and want to make sure it works there. Maybe just a branch in the review repo that switches to this version and check that the review action works fine still.

@justinxu421
Copy link
Contributor Author

justinxu421 commented Oct 9, 2025

Can we test something calling this sha from a separate repo. I've seen weirdness crop up from the directory structure that comes when an action is used from a separate repo and want to make sure it works there. Maybe just a branch in the review repo that switches to this version and check that the review action works fine still.

Good call, the import was not working, now it is d26b0d4

Example PR

Github Action success

@justinxu421 justinxu421 merged commit 4039b30 into main Oct 10, 2025
2 checks passed
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