|
16 | 16 | variables: [template: ../variables/windows.yml] |
17 | 17 | pool: ${{ parameters.AgentPool.Medium }} |
18 | 18 | steps: |
19 | | - - template: ../templates/checkout-shallow.yml |
| 19 | + - ${{ if eq(parameters.buildEnvironment, 'Continuous') }}: |
| 20 | + - template: ../templates/checkout-shallow.yml |
| 21 | + parameters: |
| 22 | + persistCredentials: true |
| 23 | + |
| 24 | + # Extract the GitHub OAuth token that ADO uses to clone the repo. |
| 25 | + # Any authenticated token raises the GitHub API rate limit from 60 to |
| 26 | + # 5,000 req/hr, which prevents validate-overrides from being throttled. |
| 27 | + - pwsh: | |
| 28 | + $headerLine = git config --get-regexp "http.*\.extraheader" 2>$null | Select-Object -First 1 |
| 29 | + if (-not $headerLine) { |
| 30 | + Write-Host "##vso[task.logissue type=warning]No HTTP extraheader found — validate-overrides will run without GitHub auth" |
| 31 | + exit 0 |
| 32 | + } |
| 33 | + $encoded = ($headerLine.Split(' ')[-1]).Trim() |
| 34 | + $decoded = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encoded)) |
| 35 | + $token = $decoded.Split(':')[-1] |
| 36 | + Write-Host "Extracted GitHub OAuth token (length=$($token.Length))" |
| 37 | + Write-Host "##vso[task.setvariable variable=GitHubOAuthToken;issecret=true]$token" |
| 38 | + displayName: Extract GitHub OAuth token |
| 39 | +
|
| 40 | + - ${{ else }}: |
| 41 | + - template: ../templates/checkout-shallow.yml |
20 | 42 |
|
21 | 43 | - template: ../templates/prepare-js-env.yml |
22 | 44 |
|
|
28 | 50 |
|
29 | 51 | - script: yarn validate-overrides |
30 | 52 | displayName: yarn validate-overrides |
| 53 | + ${{ if eq(parameters.buildEnvironment, 'Continuous') }}: |
| 54 | + env: |
| 55 | + PLATFORM_OVERRIDE_GITHUB_TOKEN: $(GitHubOAuthToken) |
31 | 56 |
|
32 | 57 | - script: npx unbroken -q --local-only --allow-local-line-sections |
33 | 58 | displayName: check local links in .md files |
|
0 commit comments