Files
fastfetch/.github/workflows/ci.yml
T
Thibaud-Vdb b6d95a0ce5 CI: declares least-privilege token permissions
Jobs without a permissions block get the repository's default token
scope, and reusable workflow calls pass the caller's grants straight
through. Scopes are now derived from what each workflow actually does
with the token:

- every build workflow declares contents: read; none of them writes
  through the GITHUB_TOKEN.
- build-linux-hosts.yml keeps security-events: write for the CodeQL
  upload; the other callers had that grant too but never upload
  scanning results, so they drop it.
- build-windows-hosts.yml gets actions: read, which the SignPath
  action documents needing to read job details and download the
  unsigned artifact.
- build-release.yml declares contents: write, matching the grant its
  caller already makes for creating the release.

Runs that execute pull request code now hold a token that can do
nothing but read the repository.
2026-08-05 20:59:02 -05:00

203 lines
4.8 KiB
YAML

name: CI
on:
- push
- pull_request
jobs:
spellcheck:
permissions:
contents: read
uses: ./.github/workflows/build-spellcheck.yml
no-features-test:
needs: spellcheck
name: No-features-test
permissions:
contents: read
uses: ./.github/workflows/build-no-features-test.yml
linux-hosts:
needs: no-features-test
name: Linux-${{ matrix.arch }}
permissions:
security-events: write
contents: read
strategy:
matrix:
include:
- arch: amd64
runs-on: ubuntu-22.04
- arch: aarch64
runs-on: ubuntu-22.04-arm
uses: ./.github/workflows/build-linux-hosts.yml
with:
arch: ${{ matrix.arch }}
runs-on: ${{ matrix.runs-on }}
linux-i686:
needs: no-features-test
name: Linux-i686
permissions:
contents: read
uses: ./.github/workflows/build-linux-i686.yml
linux-armv7l:
needs: no-features-test
name: Linux-armv7l
permissions:
contents: read
uses: ./.github/workflows/build-linux-armv7l.yml
linux-loong64:
needs: no-features-test
name: Linux-loong64
permissions:
contents: read
uses: ./.github/workflows/build-linux-loong64.yml
linux-vms:
needs: no-features-test
name: Linux-${{ matrix.arch }}
permissions:
contents: read
strategy:
matrix:
include:
- arch: riscv64
- arch: ppc64le
- arch: s390x
uses: ./.github/workflows/build-linux-vms.yml
with:
arch: ${{ matrix.arch }}
musl-amd64:
needs: no-features-test
name: Musl-amd64
permissions:
contents: read
uses: ./.github/workflows/build-musl-amd64.yml
macos-hosts:
needs: no-features-test
name: macOS-${{ matrix.arch }}
permissions:
contents: read
strategy:
matrix:
include:
- arch: amd64
runs-on: macos-15-intel
- arch: aarch64
runs-on: macos-latest
uses: ./.github/workflows/build-macos-hosts.yml
with:
arch: ${{ matrix.arch }}
runs-on: ${{ matrix.runs-on }}
omnios-amd64:
needs: no-features-test
name: OmniOS-amd64
permissions:
contents: read
uses: ./.github/workflows/build-omnios-amd64.yml
solaris-amd64:
needs: no-features-test
name: Solaris-amd64
permissions:
contents: read
uses: ./.github/workflows/build-solaris-amd64.yml
freebsd-amd64:
needs: no-features-test
name: FreeBSD-amd64
permissions:
contents: read
uses: ./.github/workflows/build-freebsd-amd64.yml
openbsd-amd64:
needs: no-features-test
name: OpenBSD-amd64
permissions:
contents: read
uses: ./.github/workflows/build-openbsd-amd64.yml
netbsd-amd64:
needs: no-features-test
name: NetBSD-amd64
permissions:
contents: read
uses: ./.github/workflows/build-netbsd-amd64.yml
dragonfly-amd64:
needs: no-features-test
name: DragonFly-amd64
permissions:
contents: read
uses: ./.github/workflows/build-dragonfly-amd64.yml
haiku-amd64:
if: false # Disabled because the Haiku build is currently broken
needs: no-features-test
name: Haiku-amd64
permissions:
contents: read
uses: ./.github/workflows/build-haiku-amd64.yml
windows-hosts:
needs: no-features-test
name: Windows-${{ matrix.arch }}
permissions:
contents: read
# The SignPath action reads job details and downloads the unsigned
# artifact with the workflow token.
actions: read
strategy:
matrix:
include:
- arch: amd64
runs-on: windows-latest
msystem: CLANG64
msystem-lower: clang64
msys-arch: x86_64
- arch: aarch64
runs-on: windows-11-arm
msystem: CLANGARM64
msystem-lower: clangarm64
msys-arch: aarch64
uses: ./.github/workflows/build-windows-hosts.yml
with:
arch: ${{ matrix.arch }}
runs-on: ${{ matrix.runs-on }}
msystem: ${{ matrix.msystem }}
msystem-lower: ${{ matrix.msystem-lower }}
msys-arch: ${{ matrix.msys-arch }}
secrets:
SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }}
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'fastfetch-cli/fastfetch'
name: Release
needs:
- linux-hosts
- linux-i686
- linux-armv7l
- linux-loong64
- linux-vms
- musl-amd64
- macos-hosts
- freebsd-amd64
- openbsd-amd64
- netbsd-amd64
- dragonfly-amd64
- solaris-amd64
- omnios-amd64
# - haiku-amd64
- windows-hosts
permissions:
contents: write
uses: ./.github/workflows/build-release.yml
with:
ffversion: ${{ needs.linux-hosts.outputs.ffversion }}