blob: e0c8b24a29263f9f2174b856c2310466f723a020 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Dependency audit
on:
schedule:
# Offset from the hour to reduce peak-time scheduling delays.
- cron: "17 3 * * *"
workflow_dispatch:
pull_request:
paths:
- .github/workflows/dependency-audit.yml
- scripts/rust/dependencies.mjs
- deny.toml
- Cargo.toml
- Cargo.lock
- "platform/**/Cargo.toml"
- "plugins/**/Cargo.toml"
- "products/**/Cargo.toml"
- "tools/**/Cargo.toml"
- products/maka/cli/DEPENDENCIES.rust.tsv
- package.json
- package-lock.json
- "packages/*/package.json"
push:
branches: [main]
paths:
- .github/workflows/dependency-audit.yml
- scripts/rust/dependencies.mjs
- deny.toml
- Cargo.toml
- Cargo.lock
- "platform/**/Cargo.toml"
- "plugins/**/Cargo.toml"
- "products/**/Cargo.toml"
- "tools/**/Cargo.toml"
- products/maka/cli/DEPENDENCIES.rust.tsv
- package.json
- package-lock.json
- "packages/*/package.json"
permissions:
contents: read
concurrency:
group: dependency-audit-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-licenses:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: latest
- name: Update stable Rust for dependency resolution
run: rustup update stable --no-self-update
- uses: taiki-e/install-action@68a389c788b2cd04016ce8c80ee23b80d2ab3d68 # v2.88.1
with:
tool: cargo-binstall
- name: Install latest Rust tools
env:
GH_TOKEN: ${{ github.token }}
run: |
cargo binstall --no-confirm --force cargo-binstall
cargo binstall --no-confirm --force cargo-deny
- name: Check Rust licenses and dependency inventory
run: node scripts/rust/dependencies.mjs check
audit:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Check out the repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: latest
cache: npm
- name: Install build dependencies
run: npm ci --ignore-scripts
- name: Audit dependencies
run: npm audit --audit-level=high
- name: Verify registry signatures
run: npm audit signatures