-
Notifications
You must be signed in to change notification settings - Fork 84
Verify downloaded archives #171
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
base: main
Are you sure you want to change the base?
Changes from all commits
254ee61
68f6c7a
a440ee1
22419e8
084e26c
6af7174
fc77a15
02836b5
135f29c
a073967
afc25dd
c25a3ba
44bbd27
39c3384
cb80bdc
8c28d41
12545bd
ed0aa9a
5a08652
1b9e70c
9aded43
5c3a85c
4dc8175
f507129
bc1dace
9cbe777
ecb6dc0
00e5cc9
0056e30
82fc4cb
2be0e70
7612c7b
2094357
fdada7b
372f34d
4f1ce51
82d68e7
a1d7c45
3b56265
3cbcb5b
337ee85
59f5637
5b522d1
5018e2b
86bb306
4c26bf9
7d54eaf
bdae7ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,14 @@ jobs: | |
| no-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install | ||
| run: | | ||
| mkdir -p dist | ||
| bun run bun_as:npm | ||
| bun run bun_as:npx | ||
| echo "$(realpath -e dist)" >> "${GITHUB_PATH}" | ||
| PATH="${PATH}:$(realpath -e dist)" | ||
| test -s bun.lock || bun run 'modules:lock' | ||
| bun install --frozen-lockfile | ||
|
|
||
| - name: Run tests | ||
| run: bun test --coverage | ||
|
|
@@ -225,14 +232,33 @@ jobs: | |
| - windows-latest | ||
|
|
||
| steps: | ||
| - name: Normalize runner details | ||
| id: normalized | ||
| shell: bash | ||
| run: | | ||
| runner_arch="$(case '${{ runner.arch }}' in | ||
| (X64) printf x64 ;; | ||
| (ARM64) printf aarch64 ;; | ||
| (*) echo "Unsupported runner.arch: ${{ runner.arch }}" >&2; exit 1 ;; | ||
| esac)" | ||
| runner_os="$(case '${{ runner.os }}' in | ||
| (macOS) printf darwin ;; | ||
| (Linux) printf linux ;; | ||
| (Windows) printf windows ;; | ||
| (*) echo "Unsupported runner.os: ${{ runner.os }}" >&2; exit 1 ;; | ||
| esac)" | ||
| printf >> "${GITHUB_OUTPUT}" -- '%s=%s\n' \ | ||
| runner_arch "${runner_arch}" \ | ||
| runner_os "${runner_os}" | ||
|
|
||
| - name: 📥 Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: 🛠️ Setup Bun | ||
| uses: ./ | ||
| id: setup_bun | ||
| with: | ||
| bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'aarch64' }}.zip" | ||
| bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{ steps.normalized.outputs.runner_os }}-${{ steps.normalized.outputs.runner_arch }}.zip" | ||
|
|
||
| - name: ▶️ Run Bun | ||
| id: run_bun | ||
|
|
@@ -261,24 +287,35 @@ jobs: | |
| https://registry.npmjs.org | ||
| @types:https://registry.yarnpkg.com | ||
|
|
||
| - name: 🔎 Display registry configurations | ||
| run: cat -v bunfig.toml | ||
|
|
||
| - name: ▶️ Install from default registry | ||
| shell: bash | ||
| run: | | ||
| output=$(bun add is-odd --verbose --force 2>&1) | ||
| status=0 | ||
| output=$(bun add is-odd --verbose --force 2>&1) || status=$? | ||
|
|
||
| if echo "$output" | grep -q "HTTP/1.1 GET https://registry.npmjs.org/is-odd"; then | ||
| if [ 0 -eq "${status}" ] && grep <<<"$output" -q "HTTP/1.1 GET https://registry.npmjs.org/is-odd"; then | ||
| echo "Successfully installed from default registry" | ||
| else | ||
| echo "${output}" | ||
| echo "Return code: ${status}" | ||
| echo "Failed to install from default registry" | ||
|
Comment on lines
+299
to
304
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Match on the registry URL, not Bun's exact verbose log prefix. These assertions currently depend on Bun printing 🔧 More robust assertion- if [ 0 -eq "${status}" ] && grep <<<"$output" -q "HTTP/1.1 GET https://registry.npmjs.org/is-odd"; then
+ if [ 0 -eq "${status}" ] && grep -Fiq "https://registry.npmjs.org/is-odd" <<<"$output"; then
echo "Successfully installed from default registry"
@@
- if [ 0 -eq "${status}" ] && grep <<<"$output" -q "HTTP/1.1 GET https://registry.yarnpkg.com/@types%2fbun"; then
+ if [ 0 -eq "${status}" ] && grep -Fiq "https://registry.yarnpkg.com/@types%2fbun" <<<"$output"; then
echo "Successfully installed from `@types` registry"Also applies to: 314-319 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't actually seen this output yet. However, it seems like removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A minimal adjustment would be to drop only - if [ 0 -eq "${status}" ] && grep <<<"$output" -q "HTTP/1.1 GET https://registry.npmjs.org/is-odd"; then
+ if [ 0 -eq "${status}" ] && grep <<<"$output" -Fq "GET https://registry.npmjs.org/is-odd"; then- if [ 0 -eq "${status}" ] && grep <<<"$output" -q "HTTP/1.1 GET https://registry.yarnpkg.com/@types%2fbun"; then
+ if [ 0 -eq "${status}" ] && grep <<<"$output" -Fq "GET https://registry.yarnpkg.com/@types%2fbun"; thenThe 🧠 Learnings used |
||
| exit 1 | ||
tcely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| fi | ||
|
|
||
| - name: ▶️ Install from @types registry | ||
| shell: bash | ||
| run: | | ||
| output=$(bun add @types/bun --verbose --force 2>&1) | ||
| status=0 | ||
| output=$(bun add @types/bun --verbose --force 2>&1) || status=$? | ||
|
|
||
| if echo "$output" | grep -q "HTTP/1.1 GET https://registry.yarnpkg.com/@types%2fbun"; then | ||
| if [ 0 -eq "${status}" ] && grep <<<"$output" -q "HTTP/1.1 GET https://registry.yarnpkg.com/@types%2fbun"; then | ||
| echo "Successfully installed from @types registry" | ||
| else | ||
| echo "${output}" | ||
| echo "Return code: ${status}" | ||
| echo "Failed to install from @types registry" | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| .DS_Store | ||
| node_modules/ | ||
| tests/build/ | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.