Skip to content

Commit

Permalink
README.md: Show an example of only running on dependency changes (#52)
Browse files Browse the repository at this point in the history
Several of the `cargo deny` checks will always produce identical results
if dependencies have not changed. Add a sample pipeline that runs all of
those checks only on pull requests that modify `Cargo.toml` or
`Cargo.lock`.
  • Loading branch information
joshtriplett authored Mar 25, 2023
1 parent 8af37f5 commit cb4dc2d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,29 @@ jobs:
arguments: --all-features
```
### Recommended pipeline to avoid sudden breakages
### Recommended pipeline if not using advisories, to only run on dependency changes
If you use this pipeline, you should have `Cargo.lock` files checked into your
repository.

```yaml
name: CI
on:
pull_request:
paths:
- '**/Cargo.lock'
- '**/Cargo.toml'
jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources
```

### Recommended pipeline if using advisories, to avoid sudden breakages

```yaml
name: CI
Expand Down

0 comments on commit cb4dc2d

Please sign in to comment.