Skip to content

Commit c0e09e1

Browse files
authored
Update quest workflows for secretless (#9894)
1 parent 3a31452 commit c0e09e1

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/quest-bulk.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ on:
88
description: "The reason for running the bulk import workflow"
99
required: true
1010
default: "Initial import into Quest (Azure DevOps)"
11+
duration:
12+
description: "The number of days to import issues for. Defaults to 5 days."
13+
required: false
14+
default: "5"
1115

1216
jobs:
1317
bulk-import:
1418
runs-on: ubuntu-latest
1519
permissions:
1620
issues: write
21+
id-token: write
1722
pull-requests: write
1823
if: ${{ github.repository_owner == 'dotnet' }}
1924

@@ -23,16 +28,25 @@ jobs:
2328
run: |
2429
echo "Reason: ${{ github.event.inputs.reason }}"
2530
31+
- name: Azure OpenID Connect
32+
id: azure-oidc-auth
33+
uses: dotnet/docs-tools/.github/actions/oidc-auth-flow@main
34+
with:
35+
client-id: ${{ secrets.CLIENT_ID }}
36+
tenant-id: ${{ secrets.TENANT_ID }}
37+
audience: ${{ secrets.OSMP_API_AUDIENCE }}
38+
2639
- name: bulk-sequester
2740
id: bulk-sequester
2841
uses: dotnet/docs-tools/actions/sequester@main
2942
env:
3043
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }}
31-
ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }}
3244
ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }}
45+
ImportOptions__ApiKeys__AzureAccessToken: ${{ steps.azure-oidc-auth.outputs.access-token }}
3346
ImportOptions__ApiKeys__SequesterPrivateKey: ${{ secrets.SEQUESTER_PRIVATEKEY }}
3447
ImportOptions__ApiKeys__SequesterAppID: ${{ secrets.SEQUESTER_APPID }}
3548
with:
3649
org: ${{ github.repository_owner }}
3750
repo: ${{ github.repository }}
3851
issue: '-1'
52+
duration: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.duration || 5 }}

.github/workflows/quest.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
permissions:
2323
issues: write
24+
id-token: write
2425
pull-requests: write
2526

2627
steps:
@@ -30,14 +31,22 @@ jobs:
3031
echo "Reason: ${{ github.event.inputs.reason }}"
3132
echo "Issue number: ${{ github.event.inputs.issue }}"
3233
34+
- name: Azure OpenID Connect
35+
id: azure-oidc-auth
36+
uses: dotnet/docs-tools/.github/actions/oidc-auth-flow@main
37+
with:
38+
client-id: ${{ secrets.CLIENT_ID }}
39+
tenant-id: ${{ secrets.TENANT_ID }}
40+
audience: ${{ secrets.OSMP_API_AUDIENCE }}
41+
3342
# This step occurs when ran manually, passing the manual issue number input
3443
- name: manual-sequester
3544
if: ${{ github.event_name == 'workflow_dispatch' }}
3645
id: manual-sequester
3746
uses: dotnet/docs-tools/actions/sequester@main
3847
env:
3948
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }}
40-
ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }}
49+
ImportOptions__ApiKeys__AzureAccessToken: ${{ steps.azure-oidc-auth.outputs.access-token }}
4150
ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }}
4251
ImportOptions__ApiKeys__SequesterPrivateKey: ${{ secrets.SEQUESTER_PRIVATEKEY }}
4352
ImportOptions__ApiKeys__SequesterAppID: ${{ secrets.SEQUESTER_APPID }}
@@ -53,12 +62,11 @@ jobs:
5362
uses: dotnet/docs-tools/actions/sequester@main
5463
env:
5564
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }}
56-
ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }}
65+
ImportOptions__ApiKeys__AzureAccessToken: ${{ steps.azure-oidc-auth.outputs.access-token }}
5766
ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }}
5867
ImportOptions__ApiKeys__SequesterPrivateKey: ${{ secrets.SEQUESTER_PRIVATEKEY }}
5968
ImportOptions__ApiKeys__SequesterAppID: ${{ secrets.SEQUESTER_APPID }}
6069
with:
6170
org: ${{ github.repository_owner }}
6271
repo: ${{ github.repository }}
6372
issue: ${{ github.event.issue.number }}
64-

0 commit comments

Comments
 (0)