-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Harden security of GitHub Actions CI/CD (#202)
* restrict permissions for GitHub actions This commit introduces two changes. First, the actions are changed to only have read access to repositories. Second, we specify that GitHub should not persist the authorization token for write access to a repository on disk (see the option `persist-credentials: false`). * pin action versions by SHA1 instead of git tag * remove codecov token It shouldn't be necessary for public repositories. * update git tags for GitHub actions Co-authored-by: Vincent Mutolo <[email protected]>
- Loading branch information
Showing
5 changed files
with
73 additions
and
39 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
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
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 |
---|---|---|
@@ -1,31 +1,36 @@ | ||
on: [push, pull_request] | ||
|
||
name: Lints | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lints: | ||
name: rustfmt and clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b | ||
with: | ||
command: clippy | ||
args: -- -D warnings |
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
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