CICD-392 · Dependency graph generation
Encyclopedia · Monorepo and large-scale build engineering · All snippets
Previous · CICD-391 · Next · CICD-393
1. Where it fits
- Placement CI evidence step.
- Prerequisites trusted checkout with the base ref fetched and pinned package manager or build tool.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
pnpm exec nx graph --file=workspace-graph.json
jq -e '.graph.nodes | length > 0' workspace-graph.json3. How it works
The command uses Nx's project graph and a selected Git range to calculate or run affected work. The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.
4. Verify the result
Compare graph changes when refactoring workspace relationships. Archive the graph for review.
Validation syntax-validated (Bash parse). Status definitions.