Repository navigation
fix(commit): refuse commit checks and commits while a commit confirmed is pending (#632) #1115
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: security | |
| # Secret scan + Rust supply-chain checks. Actions pinned to commit SHAs. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| # rustsec/audit-check publishes its findings as a check run. Without this the | |
| # action fails with "Resource not accessible by integration" on push events. | |
| checks: write | |
| concurrency: | |
| group: security-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Secret scan: the shared mechubsec workflow (pinned gitleaks binary; no | |
| # license needed, unlike gitleaks-action on org repos). | |
| secrets: | |
| uses: mechubsec/.github/.github/workflows/gitleaks.yml@fb1a159c596bf2c57b9f6f1ff99f546463a6a84a | |
| cargo: | |
| name: cargo-audit + cargo-deny | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Ensure Cargo.lock exists | |
| run: test -f Cargo.lock || cargo generate-lockfile | |
| - name: cargo-audit (RUSTSEC advisories) | |
| uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998 # v2.0.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # Installed directly rather than via cargo-deny-action, which builds its | |
| # own image and so depends on Docker Hub at run time. That dependency has | |
| # now failed this job for real: three retries of | |
| # "dial tcp ...:443: i/o timeout" pulling rust:1.85.0-alpine3.20, with | |
| # nothing wrong in the repo. A supply-chain gate that goes red on an | |
| # unrelated registry outage is a gate people learn to ignore, which is | |
| # worse than not having it. Slower, but it depends only on crates.io, | |
| # which this job already needs. Matches mecmcp and rustpanosmcp. | |
| - name: Install cargo-deny | |
| run: cargo install cargo-deny --locked | |
| - name: cargo-deny (advisories + licenses + bans + sources) | |
| run: cargo deny check advisories licenses bans sources | |
| trivy: | |
| name: trivy (fs + image) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| # Installed from the upstream release binary rather than via | |
| # aquasecurity/trivy-action, which runs as a Docker container action and | |
| # so pulls aquasec/trivy from Docker Hub at run time — the same failure | |
| # mode that pushed cargo-deny off cargo-deny-action above. Checksum | |
| # pinned against the release's published checksums.txt. | |
| - name: Install trivy | |
| env: | |
| TRIVY_VERSION: "0.73.0" | |
| TRIVY_SHA256: "2edd39da482bb4e9831962487b68f68e3928ec3137794757f54d00383d79547b" | |
| run: | | |
| curl -sSfL -o trivy.tar.gz \ | |
| "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" | |
| echo "${TRIVY_SHA256} trivy.tar.gz" | sha256sum -c - | |
| tar -xzf trivy.tar.gz trivy | |
| sudo mv trivy /usr/local/bin/trivy | |
| - name: trivy fs (dependency + config scan) | |
| run: trivy fs --config trivy.yaml --exit-code 1 --severity HIGH,CRITICAL . | |
| - name: Build image for scanning | |
| run: docker build -t rustjunosmcp:ci . | |
| - name: trivy image (container scan) | |
| run: trivy image --config trivy.yaml --exit-code 1 --severity HIGH,CRITICAL rustjunosmcp:ci |