Skip to content

Commit 35bfd89

Browse files
authored
ci: fixa actions de terceiros em commit SHA (#16)
O CodeQL apontava nove alertas actions/unpinned-tag: actions de terceiros referenciadas por tag mutavel, que pode ser reapontada para outro commit a qualquer momento. Cada uma passa a ser referenciada pelo SHA, com a versao em comentario para o Dependabot continuar atualizando. Duas refs carregavam semantica alem da versao e precisaram de ajuste: - dtolnay/rust-toolchain@stable: a branch stable era o que selecionava a toolchain. Agora o SHA e o de master e a selecao vem de `toolchain: stable`. - taiki-e/install-action@cargo-llvm-cov: a tag nomeava a ferramenta, que passa para `tool: cargo-llvm-cov`.
1 parent a751796 commit 35bfd89

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jobs:
3535
fi
3636
3737
- name: Install Rust
38-
uses: dtolnay/rust-toolchain@stable
38+
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # v1
3939
with:
40+
toolchain: stable
4041
targets: i686-unknown-linux-gnu,i686-pc-windows-msvc
4142

4243
- name: Install cross-compilation tools
@@ -116,7 +117,7 @@ jobs:
116117
cat release_body.md
117118
118119
- name: Upload release assets
119-
uses: softprops/action-gh-release@v3
120+
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
120121
with:
121122
body_path: release_body.md
122123
append_body: true

‎.github/workflows/rust.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
- uses: actions/checkout@v7
2424

2525
- name: Install Rust (stable + clippy)
26-
uses: dtolnay/rust-toolchain@stable
26+
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # v1
2727
with:
28+
toolchain: stable
2829
targets: i686-unknown-linux-gnu
2930
components: clippy
3031

@@ -33,7 +34,7 @@ jobs:
3334
sudo apt-get update
3435
sudo apt-get install -y gcc-multilib g++-multilib
3536
36-
- uses: Swatinem/rust-cache@v2
37+
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
3738

3839
- name: Build
3940
run: cargo build --target i686-unknown-linux-gnu --verbose
@@ -52,8 +53,9 @@ jobs:
5253
steps:
5354
- uses: actions/checkout@v7
5455
- name: Install Rust (stable + rustfmt)
55-
uses: dtolnay/rust-toolchain@stable
56+
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # v1
5657
with:
58+
toolchain: stable
5759
components: rustfmt
5860
- run: cargo fmt --all -- --check
5961

@@ -69,7 +71,7 @@ jobs:
6971
checks: write
7072
steps:
7173
- uses: actions/checkout@v7
72-
- uses: rustsec/audit-check@v2
74+
- uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998 # v2.0.0
7375
with:
7476
token: ${{ secrets.GITHUB_TOKEN }}
7577

@@ -82,8 +84,9 @@ jobs:
8284
- uses: actions/checkout@v7
8385

8486
- name: Install Rust (stable + llvm-tools)
85-
uses: dtolnay/rust-toolchain@stable
87+
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # v1
8688
with:
89+
toolchain: stable
8790
targets: i686-unknown-linux-gnu
8891
components: llvm-tools-preview
8992

@@ -92,10 +95,12 @@ jobs:
9295
sudo apt-get update
9396
sudo apt-get install -y gcc-multilib g++-multilib
9497
95-
- uses: Swatinem/rust-cache@v2
98+
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
9699

97100
- name: Install cargo-llvm-cov
98-
uses: taiki-e/install-action@cargo-llvm-cov
101+
uses: taiki-e/install-action@94c31af3204a9f15ab40b35ad084410b905bbc73 # v2.87.17
102+
with:
103+
tool: cargo-llvm-cov
99104

100105
- name: Generate LCOV report
101106
run: cargo llvm-cov --target i686-unknown-linux-gnu --lcov --output-path lcov.info

0 commit comments

Comments
 (0)