Repository navigation
67 lines (59 loc) · 2.32 KB
/
Copy pathpr-validation.yml
File metadata and controls
67 lines (59 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: PR Validation (F# VS Integration)
on:
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
id-token: write
jobs:
validate-and-trigger:
if: |
github.repository == 'dotnet/fsharp' &&
github.event.issue.pull_request &&
(contains(github.event.comment.body, '/pr-val') || contains(github.event.comment.body, '/dart'))
runs-on: ubuntu-latest
environment: fsharp_pr_validation
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
# issue_comment's SHA is on the default branch, never the PR branch.
ref: ${{ github.sha }}
persist-credentials: false
- name: Validate request and capture PR revision
id: request
env:
GITHUB_TOKEN: ${{ github.token }}
run: .\.github\scripts\pr-validation.ps1 -Mode Prepare
- name: Verify Microsoft organization membership
env:
GITHUB_TOKEN: ${{ github.token }}
run: .\.github\scripts\pr-validation.ps1 -Mode Membership
- name: Azure Login with OpenID Connect
uses: azure/login@8216e11d8cd9b42fe925c852af8e76311ff067ac # v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
allow-no-subscriptions: true
- name: Queue DartLab pipeline
id: queue
env:
PIPELINE_ID: ${{ vars.FSHARP_APEX_PIPELINE_ID }}
REQUEST_BODY: ${{ steps.request.outputs.body }}
run: |
$ErrorActionPreference = 'Stop'
$env:AZDO_TOKEN = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($env:AZDO_TOKEN)) { throw 'Azure did not return an access token.' }
Write-Output "::add-mask::$env:AZDO_TOKEN"
.\.github\scripts\pr-validation.ps1 -Mode Queue
- name: Report request result
if: success() || failure()
env:
GITHUB_TOKEN: ${{ github.token }}
RUN_URL: ${{ steps.queue.outputs.url }}
HEAD_SHA: ${{ steps.request.outputs.head }}
PIPELINE_SHA: ${{ steps.request.outputs.pipeline }}
run: .\.github\scripts\pr-validation.ps1 -Mode Report