Skip to content

Commit e597bf3

Browse files
authored
migrate labeler to use dd-octo-sts (DataDog#23179)
1 parent fdbeac1 commit e597bf3

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

.github/workflows/labeler-community.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ jobs:
1515
labeler:
1616
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} # only PRs from other repos
1717
permissions:
18-
pull-requests: write # Needed for labeler-reusable.yml
1918
contents: read # Needed for labeler-reusable.yml
19+
id-token: write # Needed for dd-octo-sts OIDC token exchange
20+
pull-requests: write # Needed for labeler-reusable.yml
2021
uses: ./.github/workflows/labeler-reusable.yml
21-
secrets:
22-
app-id: "${{ secrets.DD_AGENT_INTEGRATIONS_BOT_APP_ID }}"
23-
private-key: "${{ secrets.DD_AGENT_INTEGRATIONS_BOT_PRIVATE_KEY }}"

.github/workflows/labeler-reusable.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ name: Reusable Labeler Workflow
44

55
on:
66
workflow_call:
7-
secrets:
8-
app-id:
9-
required: true
10-
private-key:
11-
required: true
127

138
jobs:
149
apply:
@@ -17,15 +12,15 @@ jobs:
1712
runs-on: ubuntu-latest
1813
permissions:
1914
contents: read
15+
id-token: write # Required for dd-octo-sts OIDC token exchange
2016
pull-requests: write
2117
steps:
22-
- name: Create token
23-
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
18+
- name: Get token via dd-octo-sts
19+
uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4
2420
id: token-generator
2521
with:
26-
app-id: ${{ secrets.app-id }}
27-
private-key: ${{ secrets.private-key }}
28-
repositories: integrations-core
22+
scope: DataDog/integrations-core
23+
policy: self.labeler.pull-request
2924
- name: Add labels
3025
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
3126
with:

.github/workflows/labeler.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ jobs:
1313
labeler:
1414
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only PRs from this repo
1515
permissions:
16-
pull-requests: write # Needed for labeler-reusable.yml
1716
contents: read # Needed for labeler-reusable.yml
17+
id-token: write # Needed for dd-octo-sts OIDC token exchange
18+
pull-requests: write # Needed for labeler-reusable.yml
1819
uses: ./.github/workflows/labeler-reusable.yml
19-
secrets:
20-
app-id: "${{ secrets.DD_AGENT_INTEGRATIONS_BOT_APP_ID }}"
21-
private-key: "${{ secrets.DD_AGENT_INTEGRATIONS_BOT_PRIVATE_KEY }}"

0 commit comments

Comments
 (0)