Skip to content

Commit 8b8b688

Browse files
authored
Merge pull request #26 from DataDog/christoph.hamsen/avoid-github-token-for-pr-creation
Avoid using GITHUB_TOKEN for PR creation
2 parents 0f2f5f9 + f62a3cb commit 8b8b688

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject_pattern: repo:DataDog/managed-kubernetes-auditing-toolkit:ref:refs/tags/v.*
4+
5+
claim_pattern:
6+
event_name: push
7+
ref: refs/tags/v.*
8+
job_workflow_ref: DataDog/managed-kubernetes-auditing-toolkit/\.github/workflows/release\.yml@refs/tags/v.*
9+
10+
permissions:
11+
contents: write
12+
pull_requests: write
13+

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ on:
55
tags:
66
- "v*"
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
128
jobs:
139
goreleaser:
1410
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Needed to federate tokens for dd-octo-sts
1513
steps:
1614
- name: Checkout
1715
uses: actions/[email protected]
@@ -21,6 +19,11 @@ jobs:
2119
uses: actions/[email protected]
2220
with:
2321
go-version: 1.19
22+
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
23+
id: octo-sts
24+
with:
25+
scope: DataDog/managed-kubernetes-auditing-toolkit
26+
policy: self.release.create-pr
2427
- name: Run GoReleaser
2528
timeout-minutes: 60
2629
uses: goreleaser/[email protected]
@@ -29,4 +32,4 @@ jobs:
2932
version: latest
3033
args: release --clean --config .goreleaser.yaml
3134
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}

0 commit comments

Comments
 (0)