Skip to content

Commit 6afc65a

Browse files
committed
ci: Authenticate update-flagsmith-environment via OIDC
Replace the static FLAGSMITH_API_KEY secret with Flagsmith/setup-cli, which installs the CLI and exchanges the job's GitHub OIDC token for a short-lived access token via the org's trust relationship. The action skips the exchange when a credential is already in the environment, so the job-level FLAGSMITH_API_KEY has to go for OIDC to take effect.
1 parent fe16f9b commit 6afc65a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/update-flagsmith-environment.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ on:
77

88
permissions:
99
contents: read
10+
id-token: write # For the Flagsmith trust relationship
1011

1112
jobs:
1213
update_server_defaults:
1314
runs-on: depot-ubuntu-latest
1415
name: Update API Flagsmith Defaults
15-
env:
16-
FLAGSMITH_API_KEY: ${{ secrets.FLAGSMITH_API_KEY }}
1716

1817
steps:
1918
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
@@ -30,7 +29,7 @@ jobs:
3029
permission-pull-requests: write
3130

3231
- name: Install Flagsmith CLI
33-
run: curl -fsSL https://raw.githubusercontent.com/Flagsmith/flagsmith-cli/main/install.sh | sh
32+
uses: Flagsmith/setup-cli@c7154aaa37dff8aca0b66afc1e6722e7ad00c115 # v1.0.0
3433

3534
- name: Update defaults
3635
run: make -C api update-flagsmith-environment

0 commit comments

Comments
 (0)