Skip to content

Commit f2f276c

Browse files
committed
Switch to OIDC Federation Service instead of GitHub App
Currently, the [Gardener GitHub-Actions App](https://github.com/apps/gardener-github-actions) is used to provide more privileged access than available via the default `GITHUB_TOKEN`, for example to circumvent branch protection rules (GitHub Apps can be configured as bypassers) or cross repository privileges. To prevent sharing the GitHub App secret with each and every repository/workflow which requires usage of it, the [GitHub OIDC Federation Service](https://github.com/gardener/github-oidc-federation) has been developed. In essence, it holds the credentials for a central GitHub App and creates short-lived access tokens with a configured scope based on a centrally configured OIDC configuration. See related changes which have been necessary for this repository: - gardener/.github-oidc@bddd726 Signed-off-by: Jonas Brand (i538859) <j.brand@sap.com>
1 parent 5e212bf commit f2f276c

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ jobs:
1616
uses: gardener/cc-utils/.github/workflows/prepare.yaml@master
1717
with:
1818
mode: ${{ inputs.mode }}
19-
version-commit-callback-action-path:
2019
permissions:
21-
contents: read
20+
id-token: write
2221

2322
build:
2423
needs:
@@ -137,6 +136,7 @@ jobs:
137136
runs-on: ubuntu-latest
138137
permissions:
139138
contents: read
139+
id-token: write
140140
strategy:
141141
matrix:
142142
args:
@@ -151,11 +151,11 @@ jobs:
151151
go-version: '1.22'
152152
- if: matrix.args.run == '.ci/e2e' || matrix.args.run == '.ci/integration-test'
153153
id: token
154-
uses: actions/create-github-app-token@v2
154+
uses: gardener/cc-utils/.github/actions/github-auth@master
155155
with:
156-
app-id: ${{ vars.GARDENER_GITHUB_ACTIONS_APP_ID }}
157-
private-key: ${{ secrets.GARDENER_GITHUB_ACTIONS_PRIVATE_KEY }}
158-
owner: gardener
156+
token-server: ${{ vars.FEDERATED_GITHUB_ACCESS_TOKEN_SERVER }}
157+
permissions: |
158+
contents: read
159159
- shell: bash
160160
run: |
161161
set -euo pipefail

.github/workflows/non-release.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ jobs:
1010
mode: snapshot
1111
secrets: inherit
1212
permissions:
13-
contents: write
13+
contents: read
1414
packages: write
1515
id-token: write
1616

1717
component-descriptor:
1818
uses: gardener/cc-utils/.github/workflows/post-build.yaml@master
1919
needs:
2020
- build
21-
secrets: inherit
2221
permissions:
2322
id-token: write
2423
contents: write

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ on:
1111
jobs:
1212
build:
1313
uses: ./.github/workflows/build.yaml
14+
secrets: inherit
1415
permissions:
15-
contents: write
16+
contents: read
1617
id-token: write
1718
packages: write
1819
with:
@@ -30,7 +31,6 @@ jobs:
3031
with:
3132
release-commit-target: branch
3233
next-version: ${{ inputs.next-version }}
33-
next-version-callback-action-path:
3434
slack-channel-id: G01MH3C9UCS # #gardener-documentation
3535
assets: |
3636
- name: docforge-darwin-amd64

0 commit comments

Comments
 (0)