ci: pin all actions to verified SHAs and clear zizmor findings

Pin every action to a commit SHA whose tag comment matches (verified via gh api),
add least-privilege permissions, set persist-credentials: false, and replace the
archived actions-rs/cargo with a plain cargo test. zizmor clean at default persona.
This commit is contained in:
Christian Visintin
2026-06-07 16:58:51 +02:00
parent c652ca18b8
commit cdd4c60805
7 changed files with 45 additions and 19 deletions
+6 -2
View File
@@ -2,15 +2,19 @@ name: codeberg-mirror
on: on:
push: push:
permissions:
contents: read
jobs: jobs:
mirror: mirror:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with: with:
fetch-depth: 0 fetch-depth: 0
persist-credentials: false
- name: "Mirror to Codeberg" - name: "Mirror to Codeberg"
uses: yesolutions/mirror-action@v0.7.0 uses: yesolutions/mirror-action@1708f16cdb28634fd3ba10c5c79abc91f5578a14 # v0.7.0
with: with:
REMOTE: 'ssh://git@codeberg.org/veeso/termscp.git' REMOTE: 'ssh://git@codeberg.org/veeso/termscp.git'
GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }} GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
+6 -1
View File
@@ -9,6 +9,9 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
permissions:
contents: read
jobs: jobs:
build: build:
strategy: strategy:
@@ -19,7 +22,9 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Install termscp from script - name: Install termscp from script
run: | run: |
./install.sh -f ./install.sh -f
+9 -7
View File
@@ -14,28 +14,30 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
permissions:
contents: read
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Install dependencies - name: Install dependencies
run: sudo apt update && sudo apt install -y libdbus-1-dev libsmbclient-dev run: sudo apt update && sudo apt install -y libdbus-1-dev libsmbclient-dev
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with: with:
toolchain: nightly toolchain: nightly
components: rustfmt, clippy components: rustfmt, clippy
- name: Format - name: Format
run: cargo +nightly fmt --all -- --check run: cargo +nightly fmt --all -- --check
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with: with:
toolchain: stable toolchain: stable
components: rustfmt, clippy components: rustfmt, clippy
- name: Run tests - name: Run tests
uses: actions-rs/cargo@v1 run: cargo test --no-default-features --features github-actions --no-fail-fast
with:
command: test
args: --no-default-features --features github-actions --no-fail-fast
- name: Clippy - name: Clippy
run: cargo clippy -- -Dwarnings run: cargo clippy -- -Dwarnings
+7 -2
View File
@@ -14,12 +14,17 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
permissions:
contents: read
jobs: jobs:
build-macos: build-macos:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: dtolnay/rust-toolchain@stable with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with: with:
toolchain: stable toolchain: stable
components: rustfmt, clippy components: rustfmt, clippy
+4 -1
View File
@@ -3,6 +3,9 @@ on:
schedule: schedule:
- cron: "30 1 * * *" - cron: "30 1 * * *"
permissions:
contents: read
jobs: jobs:
close-issues: close-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -10,7 +13,7 @@ jobs:
issues: write issues: write
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/stale@v4.1.1 - uses: actions/stale@a20b814fb01b71def3bd6f56e7494d667ddf28da # v4.1.1
with: with:
days-before-issue-stale: 30 days-before-issue-stale: 30
days-before-issue-close: 7 days-before-issue-close: 7
+6 -4
View File
@@ -32,13 +32,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with: with:
path: "./site/" path: "./site/"
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v4 uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
+7 -2
View File
@@ -14,13 +14,18 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
permissions:
contents: read
jobs: jobs:
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: dtolnay/rust-toolchain@stable with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with: with:
toolchain: stable toolchain: stable
components: rustfmt, clippy components: rustfmt, clippy