From 1abd25eb31330d1a3a024e7960490635bd4711f7 Mon Sep 17 00:00:00 2001 From: Thibaud-Vdb <78480448+Totara-thib@users.noreply.github.com> Date: Fri, 13 Nov 2026 04:59:06 +0100 Subject: [PATCH] ci: take release-please from its current home, scope three workflow tokens and lock the actions (#4521) * ci: take release-please from its current home google-github-actions/release-please-action is archived: the action moved to googleapis/release-please-action, same code, same inputs, same major version, and that is where the fixes now land. The release-please workflow references the maintained repository. * ci: declare what the three unscoped workflows may do with the token Docs Build, Maintain Release Merge PR and Notify HeyPuter had no permissions block, so they ran with the repository's default token scope. Docs Build only checks out and builds, Notify HeyPuter only calls the dispatch endpoint with its own token: both declare contents: read. Maintain Release Merge PR pushes the auto-update/release branch and opens the release pull request, so it declares contents: write and pull-requests: write. The other workflows already declared their scopes and are left as they are. * ci: stop persisting the checkout credentials in the jobs that never push actions/checkout keeps the job token in the clone's git config, where every later step can read it. Twelve checkouts now set persist-credentials: false: the backend and puter.js test jobs, the coverage jobs, the type checks, the docs build, the AI provider tests and the Docker image build read the clone and push nothing with git. The two checkouts of Maintain Release Merge PR keep the token: that job resets the release branch and pushes it through create-pull-request. * ci: lock the workflow actions to the commits they resolve to GitHub's workflow dependency lockfile holds the commit each action reference resolves to, transitive actions included, and the runner uses those commits even if a tag moves later. .github/workflows/actions.lock comes from gh actions-lock (v0.4.1), which also narrowed every reference to the exact release it locked, so Dependabot keeps bumping versions and its security alerts keep matching. Re-run the same command after adding or bumping an action. * ci: drop the unused token scope from Notify HeyPuter, match workflow indentation * ci: remove the disabled release workflows release-please and Maintain Release Merge PR have been disabled since 2024; releases are cut from calver tags. Their entries leave the lockfile with them. --------- Co-authored-by: Daniel Salazar --- .github/workflows/actions.lock | 106 ++++++++++++++++++ .../ai-provider-integration-tests.yaml | 6 +- .github/workflows/backend-tests.yaml | 30 +++-- .github/workflows/dependabot-automerge.yml | 2 +- .github/workflows/docker-image.yaml | 18 +-- .github/workflows/docs-build.yml | 9 +- .github/workflows/main.yml | 40 ------- .github/workflows/notify-prod.yaml | 2 + .github/workflows/puterjs-tests.yaml | 37 +++--- .github/workflows/release-please.yml | 18 --- .github/workflows/tag-alias.yaml | 4 +- 11 files changed, 173 insertions(+), 99 deletions(-) create mode 100644 .github/workflows/actions.lock delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock new file mode 100644 index 000000000..17526556c --- /dev/null +++ b/.github/workflows/actions.lock @@ -0,0 +1,106 @@ +# This file is machine-generated by `gh actions-lock`. +# Do not edit by hand; run `gh actions-lock` to update. +# Docs: https://gh.io/actions-lockfile +version: 'v0.0.3' +workflows: + '.github/workflows/ai-provider-integration-tests.yaml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-node@v7.1.0' + '.github/workflows/backend-tests.yaml': + - 'actions/checkout@v7.0.1' + - 'actions/download-artifact@v8.0.2' + - 'actions/setup-node@v7.1.0' + - 'actions/upload-artifact@v7.0.2' + - 'davelosert/vitest-coverage-report-action@v2.13.2' + - 'dorny/paths-filter@v4.0.3' + '.github/workflows/dependabot-automerge.yml': + - 'dependabot/fetch-metadata@v3.1.0' + '.github/workflows/docker-image.yaml': + - 'actions/checkout@v7.0.1' + - 'docker/build-push-action@v7.4.0' + - 'docker/login-action@v4.8.0' + - 'docker/metadata-action@v6.2.0' + - 'docker/setup-buildx-action@v4.4.1' + - 'docker/setup-qemu-action@v4.4.0' + - 'peter-evans/dockerhub-description@v5.0.0' + '.github/workflows/docs-build.yml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-node@v7.1.0' + '.github/workflows/notify-dev.yaml': [] + '.github/workflows/notify-prod.yaml': [] + '.github/workflows/puterjs-tests.yaml': + - 'actions/checkout@v7.0.1' + - 'actions/download-artifact@v8.0.2' + - 'actions/setup-node@v7.1.0' + - 'actions/upload-artifact@v7.0.2' + - 'davelosert/vitest-coverage-report-action@v2.13.2' + - 'dorny/paths-filter@v4.0.3' + '.github/workflows/tag-alias.yaml': + - 'docker/login-action@v4.8.0' + - 'docker/setup-buildx-action@v4.4.1' +dependencies: + 'actions/checkout@v7.0.1': + ref: 'v7.0.1' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 + 'actions/download-artifact@v8.0.2': + ref: 'v8.0.2' + commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333' + owner_id: 44036562 + repo_id: 192626254 + 'actions/setup-node@v7.1.0': + ref: 'v7.1.0' + commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1' + owner_id: 44036562 + repo_id: 189476904 + 'actions/upload-artifact@v7.0.2': + ref: 'v7.0.2' + commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' + owner_id: 44036562 + repo_id: 192625955 + 'davelosert/vitest-coverage-report-action@v2.13.2': + ref: 'v2.13.2' + commit: 'sha1-74c2d9210b4fc44c84d8213f61d7ec99837b7aa0' + owner_id: 4287128 + repo_id: 501176456 + 'dependabot/fetch-metadata@v3.1.0': + ref: 'v3.1.0' + commit: 'sha1-25dd0e34f4fe68f24cc83900b1fe3fe149efef98' + owner_id: 27347476 + repo_id: 371068214 + 'docker/build-push-action@v7.4.0': + ref: 'v7.4.0' + commit: 'sha1-c3c9e263c25d99ce0380d002d59b67737d91b0dc' + owner_id: 5429470 + repo_id: 241092383 + 'docker/login-action@v4.8.0': + ref: 'v4.8.0' + commit: 'sha1-8aa5831fb8d48d8f76594c7ddde61ae58019f550' + owner_id: 5429470 + repo_id: 287743349 + 'docker/metadata-action@v6.2.0': + ref: 'v6.2.0' + commit: 'sha1-dc802804100637a589fabce1cb79ff13a1411302' + owner_id: 5429470 + repo_id: 306769011 + 'docker/setup-buildx-action@v4.4.1': + ref: 'v4.4.1' + commit: 'sha1-f87e5991a6d7451dcb8d9637bfbc97413f497069' + owner_id: 5429470 + repo_id: 288485773 + 'docker/setup-qemu-action@v4.4.0': + ref: 'v4.4.0' + commit: 'sha1-99012661954931238ded8c8b007157a8430204e1' + owner_id: 5429470 + repo_id: 288487894 + 'dorny/paths-filter@v4.0.3': + ref: 'v4.0.3' + commit: 'sha1-ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d' + owner_id: 1588572 + repo_id: 265601040 + 'peter-evans/dockerhub-description@v5.0.0': + ref: 'v5.0.0' + commit: 'sha1-1b9a80c056b620d92cedb9d9b5a223409c68ddfa' + owner_id: 18365890 + repo_id: 193685475 diff --git a/.github/workflows/ai-provider-integration-tests.yaml b/.github/workflows/ai-provider-integration-tests.yaml index d36601d88..fd521217b 100644 --- a/.github/workflows/ai-provider-integration-tests.yaml +++ b/.github/workflows/ai-provider-integration-tests.yaml @@ -17,10 +17,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' diff --git a/.github/workflows/backend-tests.yaml b/.github/workflows/backend-tests.yaml index 6f4de90c9..3edcbcca6 100644 --- a/.github/workflows/backend-tests.yaml +++ b/.github/workflows/backend-tests.yaml @@ -23,8 +23,10 @@ jobs: outputs: backend: ${{ steps.filter.outputs.backend }} steps: - - uses: actions/checkout@v7 - - uses: dorny/paths-filter@v4 + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - uses: dorny/paths-filter@v4.0.3 id: filter with: filters: | @@ -52,10 +54,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' @@ -80,13 +84,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 with: + persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' @@ -106,7 +111,7 @@ jobs: - name: Upload blob report if: ${{ !cancelled() }} - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@v7.0.2 with: name: backend-blob-${{ matrix.shard }} path: .vitest-reports/ @@ -146,13 +151,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 with: + persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' @@ -161,7 +167,7 @@ jobs: run: npm ci - name: Download blob reports - uses: actions/download-artifact@v8 + uses: actions/download-artifact@v8.0.2 with: pattern: backend-blob-* path: .vitest-reports @@ -173,7 +179,7 @@ jobs: CI: 'true' - name: Upload coverage artifact - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@v7.0.2 with: name: backend-coverage-${{ github.event_name == 'push' && 'main' || 'pr' }} path: src/backend/coverage/ @@ -204,7 +210,7 @@ jobs: - name: Report coverage on PR if: github.event_name == 'pull_request' - uses: davelosert/vitest-coverage-report-action@v2 + uses: davelosert/vitest-coverage-report-action@v2.13.2 with: json-summary-path: src/backend/coverage/coverage-summary.json json-final-path: src/backend/coverage/coverage-final.json diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 880ce7ce4..99f0342d8 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v3 + uses: dependabot/fetch-metadata@v3.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 14cd7add0..bb4cf4f1a 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -45,30 +45,32 @@ jobs: fi - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false - name: Log in to GitHub Package Container registry - uses: docker/login-action@v4 + uses: docker/login-action@v4.8.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Log in to Docker Hub - uses: docker/login-action@v4 + uses: docker/login-action@v4.8.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v4 + uses: docker/setup-qemu-action@v4.4.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 + uses: docker/setup-buildx-action@v4.4.1 - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v6 + uses: docker/metadata-action@v6.2.0 with: images: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -82,7 +84,7 @@ jobs: type=raw,value=main,enable=${{ github.event_name == 'push' || inputs.push_main }} - name: Build and push Docker image - uses: docker/build-push-action@v7 + uses: docker/build-push-action@v7.4.0 with: platforms: linux/amd64,linux/arm64 context: . @@ -95,7 +97,7 @@ jobs: cache-to: type=gha,mode=max - name: Sync README to Docker Hub - uses: peter-evans/dockerhub-description@v5 + uses: peter-evans/dockerhub-description@v5.0.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index dd4532ffd..c55f394bb 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -5,16 +5,21 @@ on: paths: - 'src/docs/**' +permissions: + contents: read + jobs: build-docs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 43f2c7bb7..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Maintain Release Merge PR - -on: - push: - branches: - - main - -jobs: - update-release-pr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - name: Setup Git - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - name: Check for existing PR - id: find-pr - uses: juliangruber/find-pull-request-action@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - branch: release - - uses: actions/checkout@v7 - if: steps.find-pr.outputs.number == '' - with: - ref: release - - name: Reset release branch - if: steps.find-pr.outputs.number == '' - run: | - git fetch origin main:main - git reset --hard main - - name: Create/Update PR - if: steps.find-pr.outputs.number == '' - uses: peter-evans/create-pull-request@v8 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update release branch - title: Merge Release Auto-PR - body: Merging this PR will invoke release actions - branch: auto-update/release diff --git a/.github/workflows/notify-prod.yaml b/.github/workflows/notify-prod.yaml index 14bfba34e..f38253346 100644 --- a/.github/workflows/notify-prod.yaml +++ b/.github/workflows/notify-prod.yaml @@ -5,6 +5,8 @@ on: branches: - main +permissions: {} + jobs: notify: runs-on: ubuntu-latest diff --git a/.github/workflows/puterjs-tests.yaml b/.github/workflows/puterjs-tests.yaml index d6ab1ad86..18bce42c7 100644 --- a/.github/workflows/puterjs-tests.yaml +++ b/.github/workflows/puterjs-tests.yaml @@ -22,8 +22,10 @@ jobs: outputs: puterjs: ${{ steps.filter.outputs.puterjs }} steps: - - uses: actions/checkout@v7 - - uses: dorny/paths-filter@v4 + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - uses: dorny/paths-filter@v4.0.3 id: filter with: filters: | @@ -52,10 +54,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' @@ -73,10 +77,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false - name: Set up Node.js - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' @@ -130,14 +136,15 @@ jobs: steps: - name: Checkout ${{ matrix.ref }} if: needs.changes.outputs.puterjs == 'true' - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 with: + persist-credentials: false ref: ${{ matrix.ref }} repository: ${{ matrix.repository }} - name: Set up Node.js if: needs.changes.outputs.puterjs == 'true' - uses: actions/setup-node@v7 + uses: actions/setup-node@v7.1.0 with: node-version: '26' cache: 'npm' @@ -161,7 +168,7 @@ jobs: - name: Upload coverage artifact if: needs.changes.outputs.puterjs == 'true' && !cancelled() - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@v7.0.2 with: name: puterjs-coverage-${{ matrix.artifact }} path: src/puter-js/coverage/coverage-*.json @@ -174,13 +181,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false # Missing when the PR leg failed; `coverage (pr)` already reports that. - name: Download PR coverage id: pr-coverage continue-on-error: true - uses: actions/download-artifact@v8 + uses: actions/download-artifact@v8.0.2 with: name: puterjs-coverage-pr path: src/puter-js/coverage @@ -191,14 +200,14 @@ jobs: id: base-coverage if: steps.pr-coverage.outcome == 'success' continue-on-error: true - uses: actions/download-artifact@v8 + uses: actions/download-artifact@v8.0.2 with: name: puterjs-coverage-base path: coverage-base - name: Report coverage on PR if: steps.pr-coverage.outcome == 'success' && steps.base-coverage.outcome == 'success' - uses: davelosert/vitest-coverage-report-action@v2 + uses: davelosert/vitest-coverage-report-action@v2.13.2 with: name: puter.js SDK json-summary-path: src/puter-js/coverage/coverage-summary.json @@ -207,7 +216,7 @@ jobs: - name: Report coverage on PR (no base comparison) if: steps.pr-coverage.outcome == 'success' && steps.base-coverage.outcome != 'success' - uses: davelosert/vitest-coverage-report-action@v2 + uses: davelosert/vitest-coverage-report-action@v2.13.2 with: name: puter.js SDK json-summary-path: src/puter-js/coverage/coverage-summary.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index f763cfdee..000000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,18 +0,0 @@ -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -name: release-please - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v4 - with: - release-type: node diff --git a/.github/workflows/tag-alias.yaml b/.github/workflows/tag-alias.yaml index f3e4b0850..d683d204f 100644 --- a/.github/workflows/tag-alias.yaml +++ b/.github/workflows/tag-alias.yaml @@ -45,14 +45,14 @@ jobs: fi - name: Log in to GitHub Package Container registry - uses: docker/login-action@v4 + uses: docker/login-action@v4.8.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 + uses: docker/setup-buildx-action@v4.4.1 - name: Create alias tag env: