Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

fix: Snyk workflow using wrong working directory for release/yarn.lock (#69510)

Nemanja Glumac360ae8c71332
diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml
index 830ed71f774..e9a6612ede9 100644
--- a/.github/workflows/snyk.yml
+++ b/.github/workflows/snyk.yml
@@ -54,16 +54,22 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- # snyk doesn't support bun yet so we generate yarn.lock and scan that
- - name: Generate yarn.lock for Snyk compatibility
+ # Snyk doesn't support bun.lock yet, so we generate yarn.lock and scan that.
+ # Bun has a bug where it normalizes "< 3.0.0" to "< 3" in alias entries
+ # but not in dependency specs, causing Snyk to fail matching dependencies.
+ # The sed commands fix this inconsistency. They continue on error to let
+ # Snyk report parsing issues directly rather than failing on the workaround.
+ - name: Generate yarn.lock
+ if: matrix.project.file == 'yarn.lock'
run: |
bun install --yarn
- cd release && bun install --yarn
- # Fix bun's yarn.lock version range normalization inconsistency
- # Bun normalizes "< 3.0.0" to "< 3" in alias entries but not in dependency specs
- # This causes Snyk to fail matching dependencies to their resolutions
- sed -i -E 's/< ([0-9]+)\.0\.0"/< \1"/g; s/< ([0-9]+)\.0"/< \1"/g' yarn.lock
- sed -i -E 's/< ([0-9]+)\.0\.0"/< \1"/g; s/< ([0-9]+)\.0"/< \1"/g' release/yarn.lock
+ sed -i -E 's/< ([0-9]+)\.0\.0"/< \1"/g; s/< ([0-9]+)\.0"/< \1"/g' yarn.lock || true
+ - name: Generate release/yarn.lock
+ if: matrix.project.file == 'release/yarn.lock'
+ run: |
+ bun install --yarn
+ sed -i -E 's/< ([0-9]+)\.0\.0"/< \1"/g; s/< ([0-9]+)\.0"/< \1"/g' yarn.lock || true
+ working-directory: release
- uses: snyk/actions/[email protected]
- name: Run snyk test
env: