Skip to content

Commit a7f6875

Browse files
committed
Migrate CI Visibility from static DATADOG_API_KEY to dd-sts
Replaces the static DATADOG_API_KEY secret with a short-lived Datadog API key obtained via dd-sts OIDC token exchange, removing the need to store long-lived credentials in repository secrets.
1 parent 9b0704a commit a7f6875

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ permissions: {}
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write # required to exchange OIDC token for Datadog API key via dd-sts
12+
contents: read # required for actions/checkout
1013
steps:
1114
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1215

@@ -35,10 +38,16 @@ jobs:
3538
go install github.com/DataDog/orchestrion@v1.4.0
3639
orchestrion pin
3740
41+
- name: Get Datadog credentials
42+
id: dd-sts
43+
uses: DataDog/dd-sts-action@2e8187910199bd93129520183c093e19aa585c75 # v1.0.0
44+
with:
45+
policy: test-infra-definitions.github.ci-visibility.push
46+
3847
- name: Test
3948
run: orchestrion go test -v $(go list ./... | grep -v /integration-tests) # We do not run integration-tests here because they require more tooling (Pulumi, invoke, ..). They will be run in a dedicated job
4049
env:
4150
DD_CIVISIBILITY_ENABLED: true
4251
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
4352
DD_ENV: ci
44-
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
53+
DD_API_KEY: ${{ steps.dd-sts.outputs.api_key }}

0 commit comments

Comments
 (0)