Skip to content

Commit

Permalink
chore: remove token where possible (#289)
Browse files Browse the repository at this point in the history
We only need this to download a single release from github. We don't need to stick this in every command's environment.
  • Loading branch information
Stebalien authored Apr 29, 2022
1 parent a55848d commit 7bb44b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/actions/rust-cargo-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
components:
description: The components to include when installing Rust
required: false
github_token:
description: Github Token
required: true
save_cache:
description: Whether to save the SSCACHE
required: false
Expand All @@ -28,6 +31,7 @@ runs:
- name: Setting up cache
uses: pl-strflt/rust-sccache-action@v1
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
CACHE_SKIP_SAVE: ${{ inputs.save_cache == '' || inputs.save_cache == 'false' }}
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ jobs:
uses: actions/checkout@v2
- name: Running rustfmt
uses: ./.github/actions/rust-cargo-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: fmt
args: -- --check
components: rustfmt
github_token: ${{ secrets.GITHUB_TOKEN }}

check-clippy:
runs-on: ubuntu-latest
Expand All @@ -28,12 +27,11 @@ jobs:
uses: actions/checkout@v2
- name: Running clippy
uses: ./.github/actions/rust-cargo-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: clippy
args: --all
components: clippy
github_token: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest
Expand All @@ -42,16 +40,14 @@ jobs:
uses: actions/checkout@v2
- name: Running tests
uses: ./.github/actions/rust-cargo-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: test
args: --all
github_token: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_INCREMENTAL: 0
CACHE_SKIP_SAVE: ${{ matrix.push == '' || matrix.push == 'false' }}
strategy:
Expand All @@ -62,10 +58,9 @@ jobs:
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: ./.github/actions/rust-cargo-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: version
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Writing bundle
env:
BUILD_FIL_NETWORK: ${{ matrix.network }}
Expand Down

0 comments on commit 7bb44b8

Please sign in to comment.