From dad7cc6019fda772575c1bf11b7c8dcceebf5658 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Mon, 29 Apr 2024 14:23:05 -0400 Subject: [PATCH] use single link, rather than multiple links This is an experiment. The "GetAllLinks" API may have been turned off. If so, try a single link. --- .github/workflows/quest.yml | 21 +++++++++++++++++---- actions/sequester/ImportIssues/Program.cs | 8 +------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/quest.yml b/.github/workflows/quest.yml index acd7e2c..6c7ce90 100644 --- a/.github/workflows/quest.yml +++ b/.github/workflows/quest.yml @@ -30,14 +30,27 @@ jobs: echo "Reason: ${{ github.event.inputs.reason }}" echo "Issue number: ${{ github.event.inputs.issue }}" + - name: Azure OpenID Connect + uses: azure/login@v1 + with: + client-id: ${{ secrets.CLIENT_ID }} + tenant-id: ${{ secrets.TENANT_ID }} + audience: ${{ secrets.OSMP_API_AUDIENCE }} + allow-no-subscriptions: true + + - name: OSMP API access + run: | + TOKEN=$(az account get-access-token --query 'accessToken' -o tsv --resource ${{ secrets.OSMP_API_AUDIENCE }}) + echo "AZURE_ACCESS_TOKEN=$TOKEN" >> $GITHUB_ENV + # This step occurs when ran manually, passing the manual issue number input - name: manual-sequester if: ${{ github.event_name == 'workflow_dispatch' }} id: manual-sequester - uses: dotnet/docs-tools/actions/sequester@main + uses: dotnet/docs-tools/actions/sequester@oidc-sandbox # TODO: change to main env: ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }} - ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }} + ImportOptions__ApiKeys__AzureAccessToken: $AZURE_ACCESS_TOKEN ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }} ImportOptions__ApiKeys__SequesterPrivateKey: ${{ secrets.SEQUESTER_PRIVATEKEY }} ImportOptions__ApiKeys__SequesterAppID: ${{ secrets.SEQUESTER_APPID }} @@ -50,10 +63,10 @@ jobs: - name: auto-sequester if: ${{ github.event_name != 'workflow_dispatch' }} id: auto-sequester - uses: dotnet/docs-tools/actions/sequester@main + uses: dotnet/docs-tools/actions/sequester@oidc-sandbox # TODO: change to main env: ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }} - ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }} + ImportOptions__ApiKeys__AzureAccessToken: $AZURE_ACCESS_TOKEN ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }} ImportOptions__ApiKeys__SequesterPrivateKey: ${{ secrets.SEQUESTER_PRIVATEKEY }} ImportOptions__ApiKeys__SequesterAppID: ${{ secrets.SEQUESTER_APPID }} diff --git a/actions/sequester/ImportIssues/Program.cs b/actions/sequester/ImportIssues/Program.cs index a6a9be4..5492f3c 100644 --- a/actions/sequester/ImportIssues/Program.cs +++ b/actions/sequester/ImportIssues/Program.cs @@ -97,15 +97,9 @@ private static async Task CreateService(ImportOptions option : IGitHubClient.CreateGitHubClient(options.ApiKeys.GitHubToken); var ospoClient = (options.ApiKeys.AzureAccessToken is not null) - ? new OspoClient(options.ApiKeys.AzureAccessToken, true) + ? new OspoClient(options.ApiKeys.AzureAccessToken, false) : null; - // Trigger the OSPO bulk import before making any edits to any issue: - if (bulkImport && ospoClient is not null) - { - await ospoClient.GetAllAsync(); - } - if (ospoClient is null) { Console.WriteLine("Warning: Imported work items won't be assigned based on GitHub assignee.");