From 8593116448d9b3690a92760d7e1a34bafa4a55b3 Mon Sep 17 00:00:00 2001 From: darkobas Date: Mon, 16 Nov 2026 13:37:17 +0100 Subject: [PATCH 1/4] ci: create release tags with the ethersphere-release app key from an environment The bee-runner key is an org secret, so any workflow on any branch can read it and mint a token that creates tags, bypassing the approval. The new release app's key lives only in this repo's release environment, which only runs from the default branch (and, for cut-release, after a second person approves). --- .github/workflows/release_github.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_github.yaml b/.github/workflows/release_github.yaml index cf6a9f1..8f3cca3 100644 --- a/.github/workflows/release_github.yaml +++ b/.github/workflows/release_github.yaml @@ -10,13 +10,15 @@ on: jobs: release-please: runs-on: ubuntu-latest + # Only this environment (default branch only) holds RELEASE_APP_KEY. + environment: release-ci steps: - name: Generate App token id: app-token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0 with: - app-id: ${{ secrets.BEE_RUNNER_APP_ID }} - private-key: ${{ secrets.BEE_RUNNER_KEY }} + app-id: ${{ vars.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_KEY }} owner: ${{ github.repository_owner }} repositories: gateway-proxy # contents: commits, branches, tags and the GitHub release @@ -26,7 +28,7 @@ jobs: permission-pull-requests: write permission-issues: write - - uses: GoogleCloudPlatform/release-please-action@v2 + - uses: googleapis/release-please-action@00911586051618367fa9c19b161a0a146ac51970 # v2 id: release with: token: ${{ steps.app-token.outputs.token }} From e68f50e40e0a29a6bc37af340d4bb83414e75903 Mon Sep 17 00:00:00 2001 From: darkobas Date: Mon, 16 Nov 2026 15:01:14 +0100 Subject: [PATCH 2/4] ci: give workflows that write explicit token permissions The repo default workflow token becomes read-only, so workflows that need write access say so: release asset uploads get contents: write, the test coverage comparison gets actions: read and pull-requests: write. --- .github/workflows/publish_deb.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish_deb.yaml b/.github/workflows/publish_deb.yaml index b83ca6c..3338263 100644 --- a/.github/workflows/publish_deb.yaml +++ b/.github/workflows/publish_deb.yaml @@ -4,6 +4,10 @@ on: release: types: [published] +# Uploads the .deb packages to the GitHub release. +permissions: + contents: write + jobs: docker-release: runs-on: ubuntu-latest From 9b88db49c90a6393c971114ebee575bf5766759c Mon Sep 17 00:00:00 2001 From: darkobas Date: Mon, 16 Nov 2026 20:07:05 +0100 Subject: [PATCH 3/4] ci: scope Docker Hub credentials to the release-ci environment Publishing jobs now read DOCKERHUB_USERNAME/PASSWORD from the release-ci environment (per-repo token, limited to this repo's images; default branch and release tags only) instead of the shared org secret. --- .github/workflows/publish_docker.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_docker.yaml b/.github/workflows/publish_docker.yaml index b591949..6e13c49 100644 --- a/.github/workflows/publish_docker.yaml +++ b/.github/workflows/publish_docker.yaml @@ -7,6 +7,8 @@ on: jobs: docker-release: runs-on: ubuntu-latest + # Docker Hub credentials are scoped to this environment (default branch / release tags only). + environment: release-ci steps: - name: Checkout uses: actions/checkout@v2 From b1ff194b22e5592b079ab42ebbf1d12f2c66ea00 Mon Sep 17 00:00:00 2001 From: darkobas Date: Tue, 17 Nov 2026 13:55:26 +0100 Subject: [PATCH 4/4] ci: drop deprecated Quay publishing Quay is deprecated and its org credentials are no longer shared with this repo. Publish to Docker Hub only. --- .github/workflows/publish_docker.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_docker.yaml b/.github/workflows/publish_docker.yaml index 6e13c49..c319a10 100644 --- a/.github/workflows/publish_docker.yaml +++ b/.github/workflows/publish_docker.yaml @@ -1,4 +1,4 @@ -name: Publish on dockerhub and quay.io +name: Publish on dockerhub on: release: @@ -14,17 +14,14 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Login to Docker and Quay + - name: Login to Docker Hub if: success() run: | printf ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - printf ${{ secrets.QUAY_PASSWORD }} | docker login --username ${{ secrets.QUAY_USERNAME }} quay.io --password-stdin TAG=$(git describe --tags --always) echo TAG=${TAG##v} >> $GITHUB_ENV - name: Build image, retag and push if: success() run: | docker build -t ethersphere/gateway-proxy:${TAG} . - docker tag ethersphere/gateway-proxy:${TAG} quay.io/ethersphere/gateway-proxy:${TAG} docker push ethersphere/gateway-proxy:${TAG} - docker push quay.io/ethersphere/gateway-proxy:${TAG}