@@ -17,24 +17,20 @@ jobs:
17
17
18
18
with :
19
19
# Test this script using changes in a fork
20
- # repository: 'Tratcher/aspnetcore'
21
20
repository : ' dotnet/aspnetcore'
22
21
path : aspnetcore
23
22
- name : Checkout runtime
24
23
25
24
with :
26
25
# Test this script using changes in a fork
27
- # repository: 'Tratcher/runtime'
28
26
repository : ' dotnet/runtime'
29
27
path : runtime
30
28
- name : Copy
31
29
shell : cmd
32
30
working-directory : .\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\
33
31
env :
34
32
ASPNETCORE_REPO : d:\a\aspnetcore\aspnetcore\aspnetcore\
35
- run : |
36
- dir
37
- CopyToAspNetCore.cmd
33
+ run : CopyToAspNetCore.cmd
38
34
- name : Diff
39
35
shell : cmd
40
36
working-directory : .\aspnetcore\
51
47
env :
52
48
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
49
run : |
54
- # Check the code is in sync
55
- $changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0
56
- if (-not $changed) { exit }
57
50
# Test this script using an issue in the local forked repo
58
- # $issue = 'https://api.github.com/repos/Tratcher/aspnetcore/issues/1'
59
51
$issue = 'https://api.github.com/repos/dotnet/aspnetcore/issues/18943'
60
- # Check if tracking issue is open/closed
61
- $Headers = @{ Authorization = 'token {0}' -f $ENV:GITHUB_TOKEN; };
62
- $result = Invoke-RestMethod -Uri $issue
63
- if ($result.state -eq "closed") {
64
- $json = "{ `"state`": `"open`" }"
65
- $result = Invoke-RestMethod -Method PATCH -Headers $Headers -Uri $issue -Body $json
66
- }
67
- # Add a comment
68
- $status = [IO.File]::ReadAllText("artifacts\status.txt")
69
- $diff = [IO.File]::ReadAllText("artifacts\diff.txt")
70
- $body = @"
71
- The shared code is out of sync.
72
- <details>
73
- <summary>The Diff</summary>
74
-
75
- ``````
76
- $status
77
- $diff
78
- ``````
79
-
80
- </details>
81
- "@
82
- $json = ConvertTo-Json -InputObject @{ 'body' = $body }
83
- $issue = $issue + '/comments'
84
- $result = Invoke-RestMethod -Method POST -Headers $Headers -Uri $issue -Body $json
52
+ .\aspnetcore\.github\workflows\ReportDiff.ps1
0 commit comments