From 7d9b63b856b048a38c22f4a41a0d83bddebaedee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 30 Oct 2026 14:55:39 +0100 Subject: [PATCH] ci: add zizmor workflow audit (#13232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: add zizmor workflow audit Runs zizmor over this repository's workflows and Dependabot config on every pull request, on pushes to the default branch and weekly, through owncloud/reusable-workflows' zizmor.yml. Any finding fails the check. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> * fix(ci): resolve zizmor findings - excessive-permissions: workflows without a permissions block ran with the repository default, which is read/write. They now default to contents: read; only create-github-release gets contents: write, for softprops/action-gh-release. audit-release only GETs the published release, which read covers. - cache-poisoning: the release workflow's setup-node steps opt out of package-manager caching, so a tag build cannot restore a cache that a branch build wrote. - artipacked: checkouts do not persist credentials. No job runs a git operation after checkout. - dependabot-cooldown: every ecosystem waits 7 days, as github-actions already does. - ref-version-mismatch: setup-php's tag is 2.40.0, without the v. - self-repository: local reusable workflows and actions are called as $/... instead of ./... . - Suppressed inline, with the reason on the line: the unpinned `npm install -g yarn npx` in the release workflow (pre-existing, left to the maintainers), the version-pinned gherlint install, and the softprops release step, which CI cannot exercise. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> * fix(ci): undo two zizmor auto-fix slips, keep scheduled runs - zizmor's template-injection auto-fix read `${{ }}` inside a shell comment in determine-release-type as an expansion: it added an env entry reading that job's own output, which is always empty, and rewrote the comment to describe something no longer true. The entry is gone and the comment describes the env indirection the later jobs now use, with the version check as a second safeguard. - Only pull request runs of the zizmor audit cancel each other now; a push to master and the weekly run share a ref. The previous commit's message is incomplete: it lists a self-repository change this repository did not need, and omits the auto-fixed template-injection findings (expressions in run: moved to env: in release.yml, release-npm-packages.yml and acceptance-tests.yml) and the cache-poisoning fix also turning off setup-go's cache in the release jobs, so a tag build cannot restore a cache a branch build wrote. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> --------- Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> Co-authored-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- .github/dependabot.yml | 8 +++ .github/workflows/acceptance-tests.yml | 49 +++++++++++++--- .github/workflows/check-licenses.yml | 5 ++ .github/workflows/deployment-test.yml | 4 ++ .github/workflows/k8s.yml | 9 ++- .github/workflows/release-npm-packages.yml | 19 +++++-- .github/workflows/release.yml | 59 +++++++++++++++----- .github/workflows/web-tests.yml | 5 ++ .github/workflows/weekly_pipeline_report.yml | 4 +- .github/workflows/zizmor.yml | 30 ++++++++++ 10 files changed, 162 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/zizmor.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6cbdc0890ee..49710b160c3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,8 @@ updates: day: sunday time: '22:00' timezone: Etc/UTC + cooldown: + default-days: 7 open-pull-requests-limit: 5 groups: minor-and-patch: @@ -21,6 +23,8 @@ updates: day: sunday time: '22:00' timezone: Etc/UTC + cooldown: + default-days: 7 open-pull-requests-limit: 5 groups: minor-and-patch: @@ -35,6 +39,8 @@ updates: day: sunday time: '22:00' timezone: Etc/UTC + cooldown: + default-days: 7 open-pull-requests-limit: 5 groups: minor-and-patch: @@ -51,6 +57,8 @@ updates: day: sunday time: '22:00' timezone: Etc/UTC + cooldown: + default-days: 7 open-pull-requests-limit: 5 groups: minor-and-patch: diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 2577da51bef..a50c7eabd6d 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -4,6 +4,9 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + jobs: detect-changes: name: detect-changes @@ -15,6 +18,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - name: Check if changes are docs-only id: check @@ -57,6 +61,8 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod @@ -69,7 +75,7 @@ jobs: - name: Enable pnpm run: corepack enable && corepack prepare pnpm@10.33.3 --activate - - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: "8.4" extensions: curl, xml, mbstring, zip, ldap, gd @@ -82,6 +88,7 @@ jobs: sudo NEEDRESTART_MODE=a apt-get install -y libvips-dev - name: Pre-checks and generate + # zizmor: ignore[adhoc-packages] gherlint is version-pinned (@1.1.0) run: | # Phase 1 — I/O + light CPU, no contention between tasks. # wa (I/O wait) will spike during npm/pnpm downloads. @@ -230,8 +237,10 @@ jobs: - apiVault steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: "8.4" extensions: curl, xml, mbstring, zip, ldap, gd @@ -314,8 +323,10 @@ jobs: - cliCommands,apiServiceAvailability # grouped: both need ClamAV + email services steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: "8.4" extensions: curl, xml, mbstring, zip, ldap, gd @@ -362,8 +373,10 @@ jobs: - apiGraphUser,apiGraph,apiGraphGroup steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: "8.4" extensions: curl, xml, mbstring, zip, ldap, gd @@ -418,8 +431,10 @@ jobs: - "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: "8.4" extensions: curl, xml, mbstring, zip, ldap, gd @@ -534,6 +549,8 @@ jobs: vault_storage: true steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: # 24.16.0 breaks playwright install (yauzl zip extraction hangs); pin to last known good. @@ -704,6 +721,8 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install libvips runtime run: | @@ -729,6 +748,8 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install libvips runtime run: | @@ -754,6 +775,8 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install libvips runtime run: | @@ -779,6 +802,8 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install libvips runtime run: | @@ -804,6 +829,8 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod @@ -837,6 +864,8 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod @@ -870,6 +899,8 @@ jobs: GOCOVERDIR: ${{ github.workspace }}/coverage-reports steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod @@ -883,14 +914,14 @@ jobs: merge-multiple: true - name: Convert coverage counters to profile - run: go tool covdata textfmt -i=${{ env.GOCOVERDIR }} -o=coverage.out + run: go tool covdata textfmt -i=${GOCOVERDIR} -o=coverage.out - name: Publish coverage summary run: | { echo "## Acceptance test coverage" echo '```' - go tool covdata percent -i=${{ env.GOCOVERDIR }} + go tool covdata percent -i=${GOCOVERDIR} echo '```' echo echo "
" @@ -911,10 +942,12 @@ jobs: - name: Check all jobs passed run: | # If docs-only, all test jobs are expected to be skipped — that's a pass - if [[ "${{ needs.detect-changes.outputs.docs-only }}" == "true" ]]; then + if [[ "${NEEDS_DETECT_CHANGES_OUTPUTS_DOCS_ONLY}" == "true" ]]; then echo "Docs-only change — skipping tests is expected." exit 0 fi if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then exit 1 fi + env: + NEEDS_DETECT_CHANGES_OUTPUTS_DOCS_ONLY: ${{ needs.detect-changes.outputs.docs-only }} diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index 961842aef47..40329c0775a 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -4,6 +4,9 @@ on: push: branches: [master, stable-*] +permissions: + contents: read + jobs: license-check: runs-on: ubuntu-latest @@ -11,6 +14,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install REUSE tool run: pip install reuse diff --git a/.github/workflows/deployment-test.yml b/.github/workflows/deployment-test.yml index 6fbe1e7d21c..fb55585ef24 100644 --- a/.github/workflows/deployment-test.yml +++ b/.github/workflows/deployment-test.yml @@ -5,6 +5,9 @@ on: schedule: - cron: "0 1 * * *" +permissions: + contents: read + jobs: test: name: ${{ matrix.example }} @@ -37,6 +40,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: owncloud/ocis + persist-credentials: false - name: Prepare hosts entry run: | diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml index 998966f90a9..26b954221d7 100644 --- a/.github/workflows/k8s.yml +++ b/.github/workflows/k8s.yml @@ -18,6 +18,9 @@ env: OCIS_WRAPPER_URL: http://localhost:5200 K8S: true +permissions: + contents: read + jobs: api-tests: name: ${{ matrix.suite }}-k8s @@ -80,9 +83,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Setup PHP ${{ env.PHP_VERSION }} - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: ${{ env.PHP_VERSION }} extensions: curl, xml, mbstring, zip, ldap, gd @@ -495,6 +500,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 diff --git a/.github/workflows/release-npm-packages.yml b/.github/workflows/release-npm-packages.yml index 37ef2dd7993..bd5bcee0b8f 100644 --- a/.github/workflows/release-npm-packages.yml +++ b/.github/workflows/release-npm-packages.yml @@ -27,6 +27,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 @@ -44,7 +46,7 @@ jobs: - name: Determine package id: package run: | - TAG="${{ github.ref_name }}" + TAG="${GITHUB_REF_NAME}" PACKAGES="babel-preset design-system eslint-config extension-sdk prettier-config tsconfig web-client web-pkg web-test-helpers" for pkg in $PACKAGES; do if [[ "$TAG" == "${pkg}-v"* ]]; then @@ -58,29 +60,36 @@ jobs: - name: Verify package version run: | - PKG="${{ steps.package.outputs.name }}" - VERSION="${{ steps.package.outputs.version }}" + PKG="${STEPS_PACKAGE_OUTPUTS_NAME}" + VERSION="${STEPS_PACKAGE_OUTPUTS_VERSION}" ACTUAL_VERSION=$(jq -r '.version' < "packages/${PKG}/package.json") echo "Build ${PKG} ${VERSION} package.json: ${ACTUAL_VERSION}" if [ "${ACTUAL_VERSION}" != "${VERSION}" ]; then echo "git tag does not match version in web/packages/${PKG}/package.json" exit 1 fi + env: + STEPS_PACKAGE_OUTPUTS_NAME: ${{ steps.package.outputs.name }} + STEPS_PACKAGE_OUTPUTS_VERSION: ${{ steps.package.outputs.version }} - name: Build tokens run: pnpm build:tokens - name: Build package run: | - PKG="${{ steps.package.outputs.name }}" + PKG="${STEPS_PACKAGE_OUTPUTS_NAME}" case "$PKG" in design-system|web-client|web-pkg|web-test-helpers) pnpm --filter "@ownclouders/${PKG}" vite build ;; esac + env: + STEPS_PACKAGE_OUTPUTS_NAME: ${{ steps.package.outputs.name }} - name: Publish to NPM run: | pnpm publish \ - --no-git-checks --filter "@ownclouders/${{ steps.package.outputs.name }}" \ + --no-git-checks --filter "@ownclouders/${STEPS_PACKAGE_OUTPUTS_NAME}" \ --access public --tag latest + env: + STEPS_PACKAGE_OUTPUTS_NAME: ${{ steps.package.outputs.name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0446e17d239..b6562f5acd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,9 @@ env: PNPM_VERSION: '10.28.1' GOLANG_BUILD_IMAGE: 'golang:1.26.8-alpine3.23@sha256:a8fa79c5bd40d880b52bd3b6d7669ecdcfd00e85facdd427d279efb5ddd79cb1' +permissions: + contents: read + jobs: determine-release-type: runs-on: ubuntu-latest @@ -31,6 +34,7 @@ jobs: with: fetch-depth: 0 fetch-tags: true + persist-credentials: false - id: info env: @@ -53,18 +57,17 @@ jobs: if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then VERSION="$VERSION_OVERRIDE" [[ -z "$VERSION" ]] && VERSION=$(next_dev) - elif [[ "${{ github.ref_type }}" == "branch" ]]; then + elif [[ "${GITHUB_REF_TYPE}" == "branch" ]]; then VERSION=$(next_dev) else VERSION="${GITHUB_REF#refs/tags/v}" fi - # `version` below is read back by nine `run:` blocks in this file (thirteen - # interpolations) as ${{ needs.determine-release-type.outputs.version }}, and each - # of those is substituted into the script text before bash sees it. Refusing - # anything that is not a version token here is what keeps those nine safe, instead - # of nine more env: blocks -- and a release version that is not a version token is - # a bug in its own right. + # `version` below is read back by the later jobs' `run:` blocks through + # NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION in their env:, so it is never + # substituted into script text. Refusing anything that is not a version token + # here is a second safeguard -- and a release version that is not a version + # token is a bug in its own right. if [[ ! "$VERSION" =~ ^[0-9A-Za-z][0-9A-Za-z.+-]*$ ]]; then echo "::error title=Invalid release version::'$VERSION' is not a version string (expected ^[0-9A-Za-z][0-9A-Za-z.+-]*$)" exit 1 @@ -81,14 +84,18 @@ jobs: needs: [determine-release-type] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod + cache: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{ env.NODE_VERSION }} - - run: npm install --silent -g yarn npx --force - - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v4 + package-manager-cache: false + - run: npm install --silent -g yarn npx --force # zizmor: ignore[adhoc-packages] pre-existing unpinned install, left to the maintainers + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: version: ${{ env.PNPM_VERSION }} - run: pnpm config set store-dir ./.pnpm-store && make ci-node-generate @@ -99,8 +106,10 @@ jobs: BUF_TOKEN: ${{ secrets.BUF_API_TOKEN }} - name: bump LatestTag run: | - VERSION="${{ needs.determine-release-type.outputs.version }}" + VERSION="${NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION}" sed -i "s/LatestTag = \".*\"/LatestTag = \"$VERSION\"/" ocis-pkg/version/version.go + env: + NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION: ${{ needs.determine-release-type.outputs.version }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: generated-code @@ -120,6 +129,8 @@ jobs: os: [linux, darwin] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: generated-code @@ -127,12 +138,15 @@ jobs: - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod + cache: false - run: | - make -C ocis release-${{ matrix.os }} OUTPUT=${{ needs.determine-release-type.outputs.version }} + make -C ocis release-${{ matrix.os }} OUTPUT=${NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION} make -C ocis release-finish if [[ "${{ matrix.os }}" == "linux" ]]; then cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/ fi + env: + NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION: ${{ needs.determine-release-type.outputs.version }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: binaries-${{ matrix.os }} @@ -144,6 +158,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 with: scan-type: fs @@ -158,6 +174,8 @@ jobs: needs: [determine-release-type, generate-code] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: generated-code @@ -165,10 +183,12 @@ jobs: - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{ env.NODE_VERSION }} + package-manager-cache: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod - - run: npm install --silent -g yarn npx "pnpm@$PNPM_VERSION" --force + cache: false + - run: npm install --silent -g yarn npx "pnpm@$PNPM_VERSION" --force # zizmor: ignore[adhoc-packages] pre-existing unpinned install, left to the maintainers # web is excluded from the generated-code artifact (see generate-code) to # avoid OOM on upload, so its node_modules — which provides the # license-checker-rseidelsohn binary — must be reinstalled here. @@ -190,16 +210,20 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod + cache: false - run: | - make changelog CHANGELOG_VERSION=$(echo "${{ needs.determine-release-type.outputs.version }}" | cut -d'-' -f1) + make changelog CHANGELOG_VERSION=$(echo "${NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION}" | cut -d'-' -f1) # calens produces empty output when no versioned changelog directory exists (e.g. dev builds). # Fall back to a pointer to the unreleased entries. if [[ $(wc -l < ocis/dist/CHANGELOG.md) -lt 5 ]]; then echo "Development release — no release notes yet. See [unreleased changes](https://github.com/owncloud/ocis/tree/master/changelog/unreleased/)." > ocis/dist/CHANGELOG.md fi + env: + NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION: ${{ needs.determine-release-type.outputs.version }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: changelog @@ -208,6 +232,8 @@ jobs: create-github-release: runs-on: ubuntu-latest + permissions: + contents: write timeout-minutes: 30 needs: [determine-release-type, build-binaries, license-check, generate-changelog, security-scan-trivy] steps: @@ -228,7 +254,7 @@ jobs: name: changelog path: . - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 - with: + with: # zizmor: ignore[superfluous-actions] the publish path only runs on a real release, CI cannot exercise a rewrite tag_name: v${{ needs.determine-release-type.outputs.version }} name: v${{ needs.determine-release-type.outputs.version }} body_path: CHANGELOG.md @@ -248,6 +274,8 @@ jobs: - create-github-release steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: binaries-linux @@ -262,9 +290,10 @@ jobs: path: release-assets - run: | python3 scripts/audit-release.py \ - --version "${{ needs.determine-release-type.outputs.version }}" \ + --version "${NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION}" \ --dir release-assets/ \ --github-release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NEEDS_DETERMINE_RELEASE_TYPE_OUTPUTS_VERSION: ${{ needs.determine-release-type.outputs.version }} diff --git a/.github/workflows/web-tests.yml b/.github/workflows/web-tests.yml index 0a1ebdb420f..f9975fa38e8 100644 --- a/.github/workflows/web-tests.yml +++ b/.github/workflows/web-tests.yml @@ -5,6 +5,9 @@ on: push: branches: [master, stable-*] +permissions: + contents: read + jobs: detect-web-changes: name: detect-web-changes @@ -18,6 +21,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - name: Check if web/ changed id: check @@ -70,6 +74,7 @@ jobs: with: # nx affected --base= (used below) needs that commit present locally fetch-depth: 0 + persist-credentials: false - name: Setup pnpm uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 diff --git a/.github/workflows/weekly_pipeline_report.yml b/.github/workflows/weekly_pipeline_report.yml index 989996d9227..46a1f27a431 100644 --- a/.github/workflows/weekly_pipeline_report.yml +++ b/.github/workflows/weekly_pipeline_report.yml @@ -19,7 +19,9 @@ jobs: container: golang:1.25-alpine steps: - name: Checkout code - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Run CI Reporter working-directory: tools/ci-reporter diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 00000000000..7829c845742 --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,30 @@ +name: Zizmor + +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + schedule: + # Weekly: online audits (known-vulnerable actions, impostor commits) can + # start failing without a code change. + - cron: '0 4 * * 1' + workflow_dispatch: + +permissions: + contents: read + +# Only pull request runs cancel each other: a push to the default branch and +# the weekly run share a ref, and neither should cancel the other. +concurrency: + group: zizmor-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + zizmor: + name: Zizmor + uses: owncloud/reusable-workflows/.github/workflows/zizmor.yml@main