From 69cec1176186b4e4e7380faca9473e7498402084 Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Mon, 30 Nov 2026 03:52:02 +0100 Subject: [PATCH] ci: run the release jobs that read secrets in the release environment (#6873) The signing keys and tokens are repository secrets, readable by any workflow on any branch, and secrets: inherit hands them all to the called release workflows. The jobs that read a secret other than GITHUB_TOKEN now name environment: release (plugins, plugin-keys, build, server-signatures, mirror, cask). secrets: inherit stays until the secrets move into the environment, so releases build and sign as before; the environment is created on first use with no rules. Refs #6701. Co-authored-by: bertyhell <1710840+bertyhell@users.noreply.github.com> --- .github/workflows/cnb-mirror.yml | 1 + .github/workflows/homebrew.yml | 1 + .github/workflows/release-build.yml | 3 +++ .github/workflows/release.yml | 3 +++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/cnb-mirror.yml b/.github/workflows/cnb-mirror.yml index aa2133d30b..77501bb2fc 100644 --- a/.github/workflows/cnb-mirror.yml +++ b/.github/workflows/cnb-mirror.yml @@ -21,6 +21,7 @@ concurrency: jobs: mirror: + environment: release runs-on: ubuntu-latest timeout-minutes: 120 env: diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index 0b96c41aaa..660ac2bfc9 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -23,6 +23,7 @@ concurrency: jobs: cask: + environment: release runs-on: ubuntu-latest timeout-minutes: 30 env: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index a6f02b07ea..a26d015c42 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,6 +19,7 @@ env: jobs: plugin-keys: permissions: {} + environment: release runs-on: ubuntu-latest outputs: keys: ${{ steps.keys.outputs.keys }} @@ -43,6 +44,7 @@ jobs: contents: write needs: plugin-keys name: Build (${{ matrix.name }}) + environment: release env: OPENIDEA_OFFICIAL_PLUGIN_KEYS: ${{ needs.plugin-keys.outputs.keys }} strategy: @@ -227,6 +229,7 @@ jobs: permissions: contents: write needs: server + environment: release runs-on: ubuntu-latest steps: - name: Signing configured diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7d6f323ac..f88d83b681 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,8 @@ env: TAG: ${{ github.event.inputs.tag || github.ref_name }} COMMUNITY_PLUGINS_INDEX: https://github.com/l0ng-ai/openidea-plugins/releases/download/index/index.json +# The jobs that read a signing key or token, here and in the workflows called below, run in +# the `release` environment, which holds those secrets. jobs: # Creates (or reuses) one draft release that every platform build uploads into. create-release: @@ -96,6 +98,7 @@ jobs: contents: write needs: create-release name: Official plugins + environment: release runs-on: ubuntu-22.04 env: SIGNING_KEY: ${{ secrets.PLUGIN_SIGNING_KEY }}