Skip to content

Commit 7e98a5f

Browse files
Use dd-octo-sts. (#3689)
1 parent d851106 commit 7e98a5f

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.github/workflows/reusable-pre-commit.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ on:
1313
required: false
1414
type: boolean
1515
default: true
16-
secrets:
17-
PIPELINE_GITHUB_APP_ID:
18-
required: false
19-
PIPELINE_GITHUB_APP_PRIVATE_KEY:
20-
required: false
2116

2217
env:
2318
GIT_AUTHOR_EMAIL: "packages@datadoghq.com"
@@ -26,14 +21,17 @@ env:
2621
jobs:
2722
pre-commit:
2823
runs-on: ubuntu-latest
24+
permissions:
25+
id-token: write
26+
contents: read
2927
steps:
3028
- name: Get GitHub App token
3129
id: get_token
32-
if: inputs.enable-commit-changes
33-
uses: actions/create-github-app-token@v1
30+
if: inputs.enable-commit-changes && github.event_name == 'pull_request'
31+
uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4
3432
with:
35-
app-id: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
36-
private-key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
33+
scope: DataDog/datadog-api-client-java
34+
policy: self.github.pre-commit.pull-requests
3735
- uses: actions/checkout@v3
3836
with:
3937
fetch-depth: 0

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
2626
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
2727
github.event_name == 'schedule'
28+
permissions:
29+
id-token: write
30+
contents: read
2831
uses: ./.github/workflows/reusable-pre-commit.yml
2932
with:
3033
enable-commit-changes: true
31-
secrets:
32-
PIPELINE_GITHUB_APP_ID: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
33-
PIPELINE_GITHUB_APP_PRIVATE_KEY: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
3434

3535
javadoc:
3636
if: >

0 commit comments

Comments
 (0)