bulk quest import #534
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "bulk quest import" | |
on: | |
schedule: | |
- cron: '0 10 * * *' # UTC time, that's 5:00 am EST, 2:00 am PST. | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: "The reason for running the bulk import workflow" | |
required: true | |
default: "Initial import into Quest (Azure DevOps)" | |
jobs: | |
bulk-import: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
pull-requests: write | |
id-token: write | |
if: ${{ github.repository_owner == 'dotnet' }} | |
steps: | |
- name: "Print manual bulk import run reason" | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
echo "Reason: ${{ github.event.inputs.reason }}" | |
- name: Azure OpenID Connect | |
uses: azure/login@v2 | |
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 | |
- name: bulk-sequester | |
id: bulk-sequester | |
uses: dotnet/docs-tools/actions/sequester@main | |
env: | |
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
ImportOptions__ApiKeys__AzureAccessToken: ${{ env.AZURE_ACCESS_TOKEN }} | |
ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }} | |
ImportOptions__ApiKeys__SequesterPrivateKey: ${{ secrets.SEQUESTER_PRIVATEKEY }} | |
ImportOptions__ApiKeys__SequesterAppID: ${{ secrets.SEQUESTER_APPID }} | |
with: | |
org: ${{ github.repository_owner }} | |
repo: ${{ github.repository }} | |
issue: '-1' | |
branch: ${{ github.ref_name }} |