Skip to content

Commit 9d262a6

Browse files
committed
ci: reduce release-shared secret exposure
Stop granting release-shared env secrets to release actor guard + release checks jobs.\n\nGuard now falls back to repo-admin authorization when app credentials are not provided, and contract tests are updated to match.
1 parent 01d6ddc commit 9d262a6

14 files changed

Lines changed: 53 additions & 59 deletions

.github/actions/release-actor-guard/action.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ inputs:
1111
required: false
1212
default: ""
1313
app_id:
14-
description: GitHub App ID used to check team membership
15-
required: true
14+
description: GitHub App ID used to check team membership (optional; when omitted, guard falls back to repo-admin check)
15+
required: false
16+
default: ""
1617
private_key:
17-
description: GitHub App private key used to check team membership
18-
required: true
18+
description: GitHub App private key used to check team membership (optional; when omitted, guard falls back to repo-admin check)
19+
required: false
20+
default: ""
1921

2022
runs:
2123
using: composite
@@ -51,6 +53,7 @@ runs:
5153
- name: Create GitHub App token for guard checks
5254
id: app_token
5355
uses: actions/create-github-app-token@v1
56+
if: ${{ inputs.app_id != '' && inputs.private_key != '' }}
5457
with:
5558
app-id: ${{ inputs.app_id }}
5659
private-key: ${{ inputs.private_key }}
@@ -68,11 +71,6 @@ runs:
6871
run: |
6972
set -euo pipefail
7073
71-
if [ -z "${APP_TOKEN:-}" ]; then
72-
echo "Missing GitHub App token for release actor guard." >&2
73-
exit 1
74-
fi
75-
7674
fallback_repo_admin() {
7775
if [ -z "${REPO_TOKEN:-}" ]; then
7876
echo "Missing repo token for release actor guard fallback." >&2
@@ -112,6 +110,12 @@ runs:
112110
echo "Actor '${ACTOR}' is a repo admin; allowing release workflow."
113111
}
114112
113+
if [ -z "${APP_TOKEN:-}" ]; then
114+
echo "No GitHub App credentials provided; authorizing via repo-admin check."
115+
fallback_repo_admin
116+
exit 0
117+
fi
118+
115119
endpoint="https://api.github.com/orgs/${ORG}/teams/${TEAM_SLUG}/memberships/${ACTOR}"
116120
resp_file="$(mktemp)"
117121
status="$(curl -sS \

.github/workflows/build-tauri.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,13 @@ jobs:
5555
permissions:
5656
contents: read
5757
runs-on: ubuntu-latest
58-
environment: release-shared
5958
steps:
6059
- name: Checkout
6160
uses: actions/checkout@v4
6261
- name: Authorize release actor
6362
uses: ./.github/actions/release-actor-guard
6463
with:
6564
team_slug: release-admins
66-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
67-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
6865

6966
resolve_source:
7067
name: Resolve source ref to SHA

.github/workflows/deploy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ jobs:
6565
permissions:
6666
contents: read
6767
runs-on: ubuntu-latest
68-
environment: release-shared
6968
steps:
7069
- name: Checkout
7170
uses: actions/checkout@v4
7271
- name: Authorize release actor
7372
uses: ./.github/actions/release-actor-guard
7473
with:
7574
team_slug: release-admins
76-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
77-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
7875

7976
deploy:
8077
needs: [release_actor_guard]

.github/workflows/promote-branch.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,13 @@ jobs:
7777
permissions:
7878
contents: read
7979
runs-on: ubuntu-latest
80-
environment: release-shared
8180
steps:
8281
- name: Checkout
8382
uses: actions/checkout@v4
8483
- name: Authorize release actor
8584
uses: ./.github/actions/release-actor-guard
8685
with:
8786
team_slug: release-admins
88-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
89-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
9087

9188
promote:
9289
needs: [release_actor_guard]

.github/workflows/promote-docs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,13 @@ jobs:
7070
permissions:
7171
contents: read
7272
runs-on: ubuntu-latest
73-
environment: release-shared
7473
steps:
7574
- name: Checkout
7675
uses: actions/checkout@v4
7776
- name: Authorize release actor
7877
uses: ./.github/actions/release-actor-guard
7978
with:
8079
team_slug: release-admins
81-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
82-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
8380

8481
promote:
8582
needs: [release_actor_guard]

.github/workflows/promote-server.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,13 @@ jobs:
8585
permissions:
8686
contents: read
8787
runs-on: ubuntu-latest
88-
environment: release-shared
8988
steps:
9089
- name: Checkout
9190
uses: actions/checkout@v4
9291
- name: Authorize release actor
9392
uses: ./.github/actions/release-actor-guard
9493
with:
9594
team_slug: release-admins
96-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
97-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
9895

9996
promote:
10097
needs: [release_actor_guard]

.github/workflows/promote-ui.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,13 @@ jobs:
160160
permissions:
161161
contents: read
162162
runs-on: ubuntu-latest
163-
environment: release-shared
164163
steps:
165164
- name: Checkout
166165
uses: actions/checkout@v4
167166
- name: Authorize release actor
168167
uses: ./.github/actions/release-actor-guard
169168
with:
170169
team_slug: release-admins
171-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
172-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
173170

174171
promote:
175172
needs: [release_actor_guard]

.github/workflows/promote-website.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,13 @@ jobs:
8585
permissions:
8686
contents: read
8787
runs-on: ubuntu-latest
88-
environment: release-shared
8988
steps:
9089
- name: Checkout
9190
uses: actions/checkout@v4
9291
- name: Authorize release actor
9392
uses: ./.github/actions/release-actor-guard
9493
with:
9594
team_slug: release-admins
96-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
97-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
9895

9996
promote:
10097
needs: [release_actor_guard]

.github/workflows/providers-contracts.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,13 @@ jobs:
8383
permissions:
8484
contents: read
8585
runs-on: ubuntu-latest
86-
environment: release-shared
8786
steps:
8887
- name: Checkout
8988
uses: actions/checkout@v4
9089
- name: Authorize release actor
9190
uses: ./.github/actions/release-actor-guard
9291
with:
9392
team_slug: release-admins
94-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
95-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
9693

9794
trusted_ref_guard:
9895
needs: [release_actor_guard]

.github/workflows/publish-github-release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,13 @@ jobs:
5959
permissions:
6060
contents: read
6161
runs-on: ubuntu-latest
62-
environment: release-shared
6362
steps:
6463
- name: Checkout
6564
uses: actions/checkout@v4
6665
- name: Authorize release actor
6766
uses: ./.github/actions/release-actor-guard
6867
with:
6968
team_slug: release-admins
70-
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
71-
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
7269

7370
publish:
7471
needs: [release_actor_guard]

0 commit comments

Comments
 (0)