Skip to content

Commit 143ea74

Browse files
authored
Merge pull request #723 from DataDog/simon.marechal/use-dd-octo-sts-tokens
Use dd-octo-sts for short lived tokens
2 parents 5332e5e + ed349a1 commit 143ea74

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
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: repo:DataDog/stratus-red-team:ref:refs/heads/main
4+
5+
claim_pattern:
6+
event_name: push
7+
ref: refs/heads/main
8+
ref_protected: "true"
9+
job_workflow_ref: DataDog/stratus-red-team/.github/workflows/release.yml@refs/heads/main
10+
11+
permissions:
12+
contents: read
13+
pull-requests: read

.github/workflows/docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
jobs:
1616
deploy:
1717
permissions:
18-
contents: write # for mkdocs gh-deploy to publish docs
18+
contents: write # for mkdocs gh-deploy to publish docs
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Harden Runner
@@ -27,7 +27,6 @@ jobs:
2727
github.com:443
2828
pypi.org:443
2929
*.actions.githubusercontent.com:443
30-
3130
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3231
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
3332
with:

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ defaults:
99
run:
1010
working-directory: ./v2
1111

12-
permissions:
13-
contents: read
14-
pull-requests: read
15-
1612
jobs:
1713
goreleaser:
1814
timeout-minutes: 120
1915
runs-on:
2016
group: Large Runner Shared Public
2117
labels: ubuntu-4-core-latest
2218
permissions:
23-
pull-requests: write
19+
id-token: write
2420
steps:
2521
- name: Harden Runner
2622
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a
@@ -41,7 +37,11 @@ jobs:
4137
go.dev:443
4238
dl.google.com:443
4339
golang.org:443
44-
40+
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
41+
id: octo-sts
42+
with:
43+
scope: DataDog/stratus-red-team
44+
policy: self.release.create-pr.sts.yml
4545
- name: Checkout
4646
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4747
with:
@@ -58,4 +58,4 @@ jobs:
5858
args: release --clean --config ../.goreleaser.yaml --timeout 600m0s --verbose --parallelism 1
5959
workdir: ./v2
6060
env:
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}

0 commit comments

Comments
 (0)