-
Notifications
You must be signed in to change notification settings - Fork 1
Push gene #6
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
Push gene #6
Changes from all commits
4fca76f
190efc2
7b7afe3
f5305ce
798400f
fefd13d
9c637fe
a09dcde
eed563e
23a692d
14e8e6e
bc04624
38c656b
a7de82f
48261b1
288a4e8
156e781
89a3d0c
7115784
b611116
49e290e
f5c60e1
4af3716
18b1f3d
311a846
2ae26b5
daf98d8
0bec5f9
aab0154
ea4e355
1233406
f07c002
2a4ebaf
8c54b5d
cdd294b
d832d2c
db8abff
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,132 @@ | ||||||||||||||
| name: "Dependency Audit & Vulnerability Scan" | ||||||||||||||
|
|
||||||||||||||
| # Run on push to main (or any branch), and on a daily schedule | ||||||||||||||
| on: | ||||||||||||||
| push: | ||||||||||||||
| branches: | ||||||||||||||
| - '**' | ||||||||||||||
| schedule: | ||||||||||||||
| - cron: '0 2 * * *' # daily at 02:00 UTC | ||||||||||||||
| workflow_dispatch: | ||||||||||||||
|
|
||||||||||||||
| concurrency: | ||||||||||||||
| group: dependency-audit | ||||||||||||||
| cancel-in-progress: true | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| audit-node: | ||||||||||||||
| name: "Node.js / npm audit" | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| if: ${{ always() }} | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Node.js | ||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||
| with: | ||||||||||||||
| node-version: '18' | ||||||||||||||
| cache: 'npm' | ||||||||||||||
|
|
||||||||||||||
| - name: Install dependencies (npm) | ||||||||||||||
| if: ${{ hashFiles('**/package-lock.json') != '' }} | ||||||||||||||
| run: | | ||||||||||||||
| npm ci | ||||||||||||||
|
|
||||||||||||||
| - name: Run npm audit (JSON) | ||||||||||||||
| if: ${{ hashFiles('**/package-lock.json') != '' }} | ||||||||||||||
| run: | | ||||||||||||||
| set -o pipefail | ||||||||||||||
| npm audit --json > npm-audit.json || true | ||||||||||||||
| cat npm-audit.json | ||||||||||||||
|
|
||||||||||||||
| - name: Upload npm audit artifact | ||||||||||||||
| if: ${{ hashFiles('**/package-lock.json') != '' }} | ||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||
| with: | ||||||||||||||
| name: npm-audit-json | ||||||||||||||
| path: npm-audit.json | ||||||||||||||
|
|
||||||||||||||
| - name: Fail on high/critical npm findings | ||||||||||||||
| if: ${{ hashFiles('**/package-lock.json') != '' }} | ||||||||||||||
| run: | | ||||||||||||||
| jq -e '.advisories as $a | ($a | to_entries | map(.value) | map(select(.severity == "high" or .severity == "critical")) | length) > 0' npm-audit.json \ | ||||||||||||||
| && (echo "High/Critical vulnerabilities found in npm dependencies" && exit 1) || echo "No high/critical npm vulnerabilities" | ||||||||||||||
|
Comment on lines
+50
to
+54
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. npm audit JSON format may have changed. The #!/bin/bash
# Check if package.json exists and what npm version format is expected
cat package.json 2>/dev/null | jq '.engines.npm // "not specified"'
# Check npm audit format documentation
echo "Verify npm audit --json output format for the npm version in use"🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| audit-go: | ||||||||||||||
| name: "Go / govulncheck" | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| if: ${{ always() }} | ||||||||||||||
| needs: audit-node | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Go | ||||||||||||||
| uses: actions/setup-go@v4 | ||||||||||||||
| with: | ||||||||||||||
| go-version: '1.24' | ||||||||||||||
|
|
||||||||||||||
| - name: Install govulncheck | ||||||||||||||
| run: | | ||||||||||||||
| set -eux | ||||||||||||||
| GO111MODULE=on go install golang.org/x/vuln/cmd/govulncheck@latest | ||||||||||||||
| export PATH=$PATH:$(go env GOPATH)/bin | ||||||||||||||
|
|
||||||||||||||
| - name: Run govulncheck (JSON) | ||||||||||||||
| run: | | ||||||||||||||
| set -eux | ||||||||||||||
| # run in module root; govulncheck returns 0 with no vulns, >0 otherwise | ||||||||||||||
| $(go env GOPATH)/bin/govulncheck -json ./... > govulncheck.json || true | ||||||||||||||
| cat govulncheck.json | ||||||||||||||
|
|
||||||||||||||
| - name: Upload govulncheck artifact | ||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||
| with: | ||||||||||||||
| name: govulncheck-json | ||||||||||||||
| path: govulncheck.json | ||||||||||||||
|
|
||||||||||||||
| - name: Fail on found Go vulnerabilities (HIGH/CRITICAL) | ||||||||||||||
| run: | | ||||||||||||||
| # govulncheck JSON has "vulns" entries; search for severity levels if available | ||||||||||||||
| if jq -e '.vulns | length > 0' govulncheck.json >/dev/null 2>&1; then | ||||||||||||||
| # Try to detect severity mentions; if none, fail so maintainers can review | ||||||||||||||
| if jq -e '.vulns | map(.fixed|length > 0 or true) | length > 0' govulncheck.json >/dev/null 2>&1; then | ||||||||||||||
| echo "Go vulnerabilities detected — please review govulncheck.json artifact." | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
| fi | ||||||||||||||
| echo "No Go vulnerabilities detected (or none reported by govulncheck)." | ||||||||||||||
|
Comment on lines
+89
to
+99
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. 🧩 Analysis chain🌐 Web query:
💡 Result:
Top-level “message” shapes (one per line){"config": { ... }}
{"SBOM": { ... }}
{"progress": { ... }}
{"osv": { ... }} // an OSV entry object
{"finding": { ... }}[1]
|
||||||||||||||
|
|
||||||||||||||
| results-notify: | ||||||||||||||
| name: "Publish summary" | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| needs: [audit-node, audit-go] | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Download artifacts | ||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||
| with: | ||||||||||||||
| path: artifacts | ||||||||||||||
|
|
||||||||||||||
| - name: Create short summary comment (if run from PR) | ||||||||||||||
| if: github.event_name == 'pull_request' | ||||||||||||||
| uses: actions/github-script@v7 | ||||||||||||||
| with: | ||||||||||||||
| script: | | ||||||||||||||
| const fs = require('fs'); | ||||||||||||||
| const path = 'artifacts'; | ||||||||||||||
| let summary = `🔎 Dependency audit artifacts available:\\n\\n`; | ||||||||||||||
| const files = fs.readdirSync(path); | ||||||||||||||
| files.forEach(f => summary += `- ${f}\\n`); | ||||||||||||||
| github.rest.issues.createComment({ | ||||||||||||||
| owner: context.repo.owner, | ||||||||||||||
| repo: context.repo.repo, | ||||||||||||||
| issue_number: context.issue.number || github.context.payload.pull_request.number, | ||||||||||||||
| body: summary | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| - name: Finish | ||||||||||||||
| run: echo "Artifacts uploaded: $(ls -la artifacts || true)" | ||||||||||||||
|
Comment on lines
+131
to
+132
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. YAML syntax error on line 132. Static analysis indicates a YAML syntax error. The 🐛 Suggested fix - name: Finish
- run: echo "Artifacts uploaded: $(ls -la artifacts || true)"
+ run: |
+ echo "Artifacts uploaded:"
+ ls -la artifacts || true📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.11)[error] 132-132: could not parse as YAML: mapping values are not allowed in this context (syntax-check) 🪛 YAMLlint (1.38.0)[error] 132-132: syntax error: mapping values are not allowed here (syntax) 🤖 Prompt for AI Agents
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. @dependabot fix this |
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # For most projects, this workflow file will not need changing; you simply need | ||
| # to commit it to your repository. | ||
| # | ||
| # You may wish to alter this file to override the set of languages analyzed, | ||
| # or to provide custom queries or build logic. | ||
| # | ||
| # ******** NOTE ******** | ||
| # We have attempted to detect the languages in your repository. Please check | ||
| # the `language` matrix defined below to confirm you have the correct set of | ||
| # supported CodeQL languages. | ||
| # | ||
| name: "CodeQL Advanced" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| schedule: | ||
| - cron: '15 15 * * 0' | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| # Runner size impacts CodeQL analysis time. To learn more, please see: | ||
| # - https://gh.io/recommended-hardware-resources-for-running-codeql | ||
| # - https://gh.io/supported-runners-and-hardware-resources | ||
| # - https://gh.io/using-larger-runners (GitHub.com only) | ||
| # Consider using larger runners or machines with greater resources for possible analysis time improvements. | ||
| runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} | ||
| permissions: | ||
| # required for all workflows | ||
| security-events: write | ||
|
|
||
| # required to fetch internal or private CodeQL packs | ||
| packages: read | ||
|
|
||
| # only required for workflows in private repositories | ||
| actions: read | ||
| contents: read | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - language: actions | ||
| build-mode: none | ||
| - language: go | ||
| build-mode: autobuild | ||
| - language: javascript-typescript | ||
| build-mode: none | ||
| # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' | ||
| # Use `c-cpp` to analyze code written in C, C++ or both | ||
| # Use 'java-kotlin' to analyze code written in Java, Kotlin or both | ||
| # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both | ||
| # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, | ||
| # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. | ||
| # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how | ||
| # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Add any setup steps before running the `github/codeql-action/init` action. | ||
| # This includes steps like installing compilers or runtimes (`actions/setup-node` | ||
| # or others). This is typically only required for manual builds. | ||
| # - name: Setup runtime (example) | ||
| # uses: actions/setup-example@v1 | ||
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} | ||
| # If you wish to specify custom queries, you can do so here or in a config file. | ||
| # By default, queries listed here will override any specified in a config file. | ||
| # Prefix the list here with "+" to use these queries and those in the config file. | ||
|
|
||
| # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
| # queries: security-extended,security-and-quality | ||
|
|
||
| # If the analyze step fails for one of the languages you are analyzing with | ||
| # "We were unable to automatically build your code", modify the matrix above | ||
| # to set the build mode to "manual" for that language. Then modify this step | ||
| # to build your code. | ||
| # ℹ️ Command-line programs to run using the OS shell. | ||
| # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
| - name: Run manual build steps | ||
| if: matrix.build-mode == 'manual' | ||
| shell: bash | ||
| run: | | ||
| echo 'If you are using a "manual" build mode for one or more of the' \ | ||
| 'languages you are analyzing, replace this with the commands to build' \ | ||
| 'your code, for example:' | ||
| echo ' make bootstrap' | ||
| echo ' make release' | ||
| exit 1 | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v4 | ||
| with: | ||
| category: "/language:${{matrix.language}}" |
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.
Critical: Workflow file is in wrong directory and won't execute.
The file path
.github/workflows/.github/workflows/dependency-audit.ymlis nested incorrectly. GitHub Actions only recognizes workflows directly under.github/workflows/. This workflow will never run.Move the file to
.github/workflows/dependency-audit.yml.🤖 Prompt for AI Agents