-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for dependabot and cargo vet
- Loading branch information
1 parent
e6b6c42
commit 734029b
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Runs cargo vet and cargo vet regenerate exemptions for Dependabot PRs | ||
name: Dependabot update cargo vet | ||
on: | ||
push: | ||
branches: | ||
- "dependabot/cargo/**" | ||
|
||
jobs: | ||
vet: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
CARGO_VET_VERSION: 0.8.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ runner.tool_cache }}/cargo-vet | ||
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }} | ||
|
||
- name: Add the tool cache directory to the search path | ||
run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH | ||
|
||
- name: Ensure that the tool cache is populated with the cargo-vet binary | ||
run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet | ||
|
||
- run: cargo vet | ||
continue-on-error: true | ||
|
||
# These all ask for input on the terminal to select the trusted criteria but take the default of `safe-to-deploy`. | ||
|
||
- run: cargo vet trust --all BurntSushi | ||
continue-on-error: true | ||
|
||
- run: cargo vet trust --all sunfishcode | ||
continue-on-error: true | ||
|
||
- run: cargo vet trust --all dtolnay | ||
continue-on-error: true | ||
|
||
- run: cargo vet trust --all cuviper | ||
continue-on-error: true | ||
|
||
- run: cargo vet trust --all Amanieu | ||
continue-on-error: true | ||
|
||
- run: cargo vet regenerate exemptions | ||
|
||
- name: commit and push | ||
shell: bash | ||
run: | | ||
if ! git diff --exit-code; then | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git commit -am "[dependabot skip] Regenerate cargo vet" | ||
git push | ||
fi |