Repository navigation
ci: add Codecov, Snyk, SonarCloud and Codacy badges #51
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Snyk | ||
|
|
||
| # Tests the npm locks that pin the load checks' CLIs. laconic-check has no | ||
| # third-party crates, so there is no Cargo graph to test. It runs weekly and | ||
| # when a dependency file changes, which keeps it inside the free plan's monthly | ||
| # test allowance. | ||
| on: | ||
| schedule: | ||
| - cron: "23 4 * * 1" | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/ci/*/package-lock.json" | ||
| - ".github/workflows/snyk.yml" | ||
| pull_request: | ||
| paths: | ||
| - ".github/ci/*/package-lock.json" | ||
| - ".github/workflows/snyk.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Snyk open source test | ||
| # Pull requests from forks, and Dependabot's (which get Dependabot secrets | ||
| # only), receive no SNYK_TOKEN; the weekly run on main scans their changes. | ||
| if: github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]') | ||
|
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. 🟡 MEDIUM RISK This workflow does not scan Dependabot pull requests, so dependency updates can merge without Snyk validating the proposed lockfiles. Provide a trusted-token path for these pull requests or revise the documented scanning coverage.
|
||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| env: | ||
| # One dependency set per line: npm:<package-lock.json>. | ||
| SNYK_TARGETS: | | ||
| npm:.github/ci/claude-code/package-lock.json | ||
| npm:.github/ci/pi/package-lock.json | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: snyk/actions/setup@9adf32b1121593767fc3c057af55b55db032dc04 # v1.0.0 | ||
| - name: Test each dependency set | ||
| env: | ||
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
| run: | | ||
| set -uo pipefail | ||
| if [ -z "$SNYK_TOKEN" ]; then | ||
| echo "::error::The SNYK_TOKEN repository secret is not set, so nothing was scanned." | ||
| exit 1 | ||
| fi | ||
| status=0 | ||
| while IFS=: read -r kind target; do | ||
| [ -n "$kind" ] || continue | ||
| case "$kind" in | ||
| npm) snyk test --file="$target" --project-name="$target" || status=1 ;; | ||
| *) echo "::error::Unknown dependency set $kind:$target"; status=1 ;; | ||
| esac | ||
| done <<< "$SNYK_TARGETS" | ||
| exit "$status" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Codecov reports coverage for the README badge. CI sets no coverage gate, so | ||
| # Codecov's own statuses are informational and it posts no comments. | ||
| coverage: | ||
| status: | ||
| project: | ||
| default: | ||
| informational: true | ||
| patch: | ||
| default: | ||
| informational: true | ||
| comment: false |
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.
🟡 MEDIUM RISK
Add the dependency manifests to both the push and pull-request path filters, such as
.github/ci/*/package.json, so manifest changes trigger Snyk scanning.TIPReact 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.