Files
greptimedb/.github/workflows/dependency-check.yml
T
dennis zhuang cafa744e51 ci: save release and dependency-check Rust caches only on main (#10758)
* ci: save release and dependency-check Rust caches only on main

The macOS and Windows release builds and the dependency check saved Rust
caches on every ref, including tags and PRs. Those caches are unreachable
from other refs and evict main's caches. Save them only on main, and
extend the cache policy test to every workflow and composite action.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* ci: correct the macOS rust-cache key comment

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-11-30 15:36:51 +00:00

40 lines
992 B
YAML

name: Check Dependencies
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
jobs:
check-dependencies:
if: ${{ github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- name: Run cargo tree
run: cargo tree --prefix none > dependencies.txt
- name: Extract dependency names
run: awk '{print $1}' dependencies.txt > dependency_names.txt
- name: Check for blacklisted crates
run: |
while read -r dep; do
if grep -qFx "$dep" dependency_names.txt; then
echo "Blacklisted crate '$dep' found in dependencies."
exit 1
fi
done < .github/cargo-blacklist.txt
echo "No blacklisted crates found."