Skip to content

Conversation

@nathro
Copy link
Collaborator

@nathro nathro commented Oct 8, 2025

Remove Bun runtime dependency from GitHub Action

This PR simplifies the action setup by removing the Bun runtime dependency and switching to npm for execution.

Changes:

  • Remove the Setup Bun step from the workflow
  • Replace bun run with npm run for executing the action script

Impact:
Reduces external dependencies and simplifies the action's setup process, making it easier to maintain and potentially faster to initialize.


🤖 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.

This PR attempts to remove the Bun dependency, but the implementation has critical issues that will prevent the action from working. The main problems are: incorrect npm command syntax, missing TypeScript execution infrastructure, and incompatible shebang.


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

action.yml Outdated
with:
bun-version: latest
- name: Test list directory
run: ls
Copy link

Choose a reason for hiding this comment

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

Critical Issue: The command npm run $GITHUB_ACTION_PATH/src/index.ts is incorrect and will fail.

npm run expects a script name defined in package.json, not a file path. For example, npm run dev or npm run test.

Current code:

run: npm run $GITHUB_ACTION_PATH/src/index.ts

The problem: There's no script in package.json that matches this path, and npm run doesn't accept file paths as arguments.

Suggested approach: You need to either:

  1. Use Node.js directly with a TypeScript runner:
run: node --import tsx $GITHUB_ACTION_PATH/src/index.ts

(Requires adding tsx as a dependency)

  1. Or use Node.js 22's experimental TypeScript support:
run: node --experimental-strip-types $GITHUB_ACTION_PATH/src/index.ts
  1. Or compile TypeScript first, then run the compiled JavaScript:
run: |
  cd $GITHUB_ACTION_PATH
  npm install
  npx tsc
  node dist/index.js

Note: Option 2 is the simplest since Node 22 is already being set up, but it's still experimental. Option 1 with tsx is more stable.

action.yml Outdated
with:
bun-version: latest
- name: Test list directory
run: ls
Copy link

Choose a reason for hiding this comment

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

Additional Issue: The action doesn't install dependencies before running the script.

The TypeScript code imports several npm packages (@actions/core, nunjucks, @octokit/rest, etc.) that need to be installed. Without running npm install first, these imports will fail.

Suggested improvement:

- name: Install dependencies
  run: |
    cd $GITHUB_ACTION_PATH
    npm install --production
  shell: bash
- name: Run Augment Agent
  run: node --experimental-strip-types $GITHUB_ACTION_PATH/src/index.ts
  shell: bash

The --production flag ensures only runtime dependencies are installed, not devDependencies.

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 simplifying the action by removing the Bun step. I left one comment about the new run command that likely won’t execute as intended. Otherwise the change looks straightforward.

action.yml Outdated
bun-version: latest
- name: Test list directory
run: ls
shell: bash

Choose a reason for hiding this comment

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

Using npm run $GITHUB_ACTION_PATH/src/index.ts is unlikely to work because npm run expects a script name defined in a local package.json (not a file path), so this will likely fail with a missing script. Since the path points under $GITHUB_ACTION_PATH, there may be no matching script in the workflow’s working directory (also applies to other environments using this action).

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

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Additional Migration Considerations

Beyond the issues noted in the inline review comments, there are several other aspects of the codebase that need to be addressed for a complete migration from Bun to Node.js:

1. Shebang in src/index.ts

The file currently has #!/usr/bin/env bun which is incompatible with Node.js execution. This should be updated if you plan to make the file directly executable.

2. Other Workflows Still Use Bun

Several GitHub Actions workflows in .github/workflows/ still depend on Bun:

  • format-check.yml - Uses setup-bun and bun install
  • release.yml - Uses setup-bun and bun run typecheck

These workflows will need to be updated to use Node.js and npm instead.

3. Package.json Scripts

All scripts in package.json use Bun commands:

"test": "bun test",
"typecheck": "bun --bun tsc --noEmit",
"dev": "bun --watch src/index.ts"

These should be updated to use npm/node equivalents.

4. Documentation Updates

The RELEASE.md file references Bun commands (e.g., bun run version:patch). These should be updated to use npm.

5. Lock File

The project has bun.lock but no package-lock.json. You'll need to:

  • Delete bun.lock
  • Run npm install to generate package-lock.json
  • Update .prettierignore to reference package-lock.json instead of bun.lock

Recommendation: This PR should be expanded to include all these changes for a complete migration, or the scope should be clarified if only partial migration is intended.

@nathro nathro closed this Oct 8, 2025
@nathro nathro deleted the remove_bun_dependency branch October 8, 2025 16:21
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.

2 participants