Skip to content

Commit

Permalink
use single link, rather than multiple links
Browse files Browse the repository at this point in the history
This is an experiment.

The "GetAllLinks" API may have been turned off. If so, try a single link.
  • Loading branch information
BillWagner committed Apr 29, 2024
1 parent 8439e73 commit dad7cc6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/quest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
8 changes: 1 addition & 7 deletions actions/sequester/ImportIssues/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,9 @@ private static async Task<QuestGitHubService> 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.");
Expand Down

0 comments on commit dad7cc6

Please sign in to comment.