-
Notifications
You must be signed in to change notification settings - Fork 94
chore: compile once for all runs #1242
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
408497a
1de79ac
ecab3ae
83829fa
638c93a
63f0e1b
1070b30
89af78a
1182f53
cca2cb2
ac2714a
0e4bc6b
68df113
a0c2df5
daf3bb1
34a3775
24f3a30
651dfa2
caad6d1
780b4a4
c6b789b
062f4ff
0162cf4
9b9f790
43c0b97
ba87fbe
77fafd7
d404aa1
dfbb5ee
c3be90f
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 |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Snyk Test | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - "v*.*.*" | ||
| pull_request: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test-snyk: | ||
| name: Run Snyk | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name != 'pull_request' || (github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository) | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node environment | ||
| uses: ./.github/workflows/actions/setup-node-environment | ||
|
|
||
| - name: Run Snyk Test | ||
| shell: bash | ||
| env: | ||
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
| run: | | ||
| pnpm run snyk-test | ||
|
|
||
| - name: Upload Snyk Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Snyk Report - ${{ github.run_id }} | ||
| path: | | ||
| .sbom/snyk-test-result.html | ||
| .sbom/snyk-test-result.json | ||
|
|
||
| - name: Generate Vulnerability Report (Fail on >= High) | ||
| continue-on-error: ${{ github.event_name == 'pull_request' }} | ||
| shell: bash | ||
| run: | | ||
| pnpm run generate-vulnerability-report > /dev/null | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,7 @@ | |||||
| "watch:extension-bundles": "webpack --mode development --watch", | ||||||
| "pretest": "pnpm run compile", | ||||||
| "test": "pnpm run test-webview && pnpm run test-extension", | ||||||
| "test-ci": "pnpm run test-webview && pnpm run test-extension", | ||||||
| "test-extension": "cross-env MDB_IS_TEST=true NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js", | ||||||
| "test-webview": "mocha -r ts-node/register --exit --grep=\"${MOCHA_GREP}\" --file ./src/test/setup-webview.ts src/test/suite/views/**/*.test.tsx", | ||||||
| "test-install": "bash ./scripts/test-vsix-install.sh", | ||||||
|
|
@@ -66,7 +67,7 @@ | |||||
| "check-vsix-size": "node ./scripts/check-vsix-size.ts", | ||||||
| "release-draft": "node ./scripts/release-draft.js", | ||||||
| "reformat": "eslint . --fix && prettier --write .", | ||||||
| "snyk-test": "node scripts/snyk-test.js", | ||||||
| "snyk-test": "node scripts/snyk-test.ts", | ||||||
|
||||||
| "snyk-test": "node scripts/snyk-test.ts", | |
| "snyk-test": "node -r ts-node/register scripts/snyk-test.ts", |
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.
This workflow uploads artifacts via
actions/upload-artifact, but the workflow-levelpermissionsblock restricts the token scopes to onlycontents: read(all other scopes becomenone). This commonly causes artifact upload to fail with authorization errors. Add the required permission (typicallyactions: write) or remove the restrictive permissions block if the repo relies on default permissions.