Ver código fonte

【新增,CI】添加 Dependabot 与依赖安全审计

PJ568 3 meses atrás
pai
commit
1ce1172b88
2 arquivos alterados com 21 adições e 10 exclusões
  1. 10 0
      .github/dependabot.yml
  2. 11 10
      .github/workflows/checks.yml

+ 10 - 0
.github/dependabot.yml

@@ -0,0 +1,10 @@
+version: 2
+updates:
+  - package-ecosystem: "cargo"
+    directory: "/"
+    schedule:
+      interval: "weekly"
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "weekly"

+ 11 - 10
.github/workflows/checks.yml

@@ -33,17 +33,18 @@ jobs:
       - name: Test project
         run: cargo test --all-targets
 
-      # - name: Install cargo-audit
-      #   run: cargo install cargo-audit
-      # - name: Audit dependencies for vulnerabilities
-      #   run: cargo audit
-
-      # - name: Install cargo-deny
-      #   run: cargo install cargo-deny
-      # - name: Check bans, licenses, and advisories with cargo-deny
-      #   run: cargo deny check
-
       - name: Check documentation
         run: cargo doc --no-deps --document-private-items
         env:
           RUSTDOCFLAGS: -D warnings
+
+  audit:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Security audit
+        uses: rustsec/audit-check@v2
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}