fix(clippy): allow unprivileged runs of clippy (#3558)
This commit is contained in:
parent
f6b0dc74ac
commit
943a38a0d6
|
|
@ -28,14 +28,33 @@ jobs:
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Run clippy
|
- name: Check workflow permissions
|
||||||
|
id: check_permissions
|
||||||
|
uses: scherermichael-oss/action-has-permission@1.0.6
|
||||||
|
with:
|
||||||
|
required-permission: write
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Run clippy action to produce annotations
|
||||||
uses: actions-rs/clippy-check@v1.0.7
|
uses: actions-rs/clippy-check@v1.0.7
|
||||||
|
if: ${{ steps.check_permissions.outputs.has-permission }}
|
||||||
with:
|
with:
|
||||||
# GitHub displays the clippy job and its results as separate entries
|
# GitHub displays the clippy job and its results as separate entries
|
||||||
name: Clippy (stable) Results
|
name: Clippy (stable) Results
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
args: --all-features --all-targets -- -D warnings
|
args: --all-features --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1.0.1
|
||||||
|
if: ${{ !steps.check_permissions.outputs.has-permission }}
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Run clippy manually without annotations
|
||||||
|
if: ${{ !steps.check_permissions.outputs.has-permission }}
|
||||||
|
run: cargo clippy --all-features --all-targets -- -D warnings
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
name: Rustfmt
|
name: Rustfmt
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
@ -46,7 +65,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1.0.1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue