Skip to content

Automatically send a PR for runtime changes #19305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 57 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
48f02fb
Create runtime code sync action
Tratcher Feb 6, 2020
2ade36d
Call CopyToAspNetCore.cmd
Tratcher Feb 7, 2020
5643782
Fix spacing
Tratcher Feb 7, 2020
338fff0
Exit code?
Tratcher Feb 7, 2020
cd123f5
Override error
Tratcher Feb 7, 2020
f78f2eb
More error codes
Tratcher Feb 7, 2020
a9c26c1
My Fork of runtime with patched script
Tratcher Feb 7, 2020
8f96226
Remove old comment
Tratcher Feb 7, 2020
94c7a3b
Upload artifacts
Tratcher Feb 10, 2020
8556cd6
Add path
Tratcher Feb 10, 2020
6340323
file names?
Tratcher Feb 10, 2020
6978555
Combine artifacts
Tratcher Feb 10, 2020
10ca390
Make artifacts dir
Tratcher Feb 10, 2020
2c90746
Pass/Fail
Tratcher Feb 11, 2020
2e2830d
continue-on-error
Tratcher Feb 11, 2020
fbdf5d5
React to dir restructure
Tratcher Feb 12, 2020
293c36a
Fix status path
Tratcher Feb 12, 2020
6ab99aa
Triggering a run
Tratcher Feb 12, 2020
e4bec4b
Powershell!
Tratcher Feb 12, 2020
c7ee4da
bools
Tratcher Feb 12, 2020
0e93d2a
typo
Tratcher Feb 12, 2020
ae96291
artifacts path
Tratcher Feb 12, 2020
de60064
wrong typo
Tratcher Feb 12, 2020
a0ced12
simplified auth
Tratcher Feb 12, 2020
441088f
Test issue in my own repo
Tratcher Feb 12, 2020
710db6d
Post a comment
Tratcher Feb 12, 2020
cda4528
Include content
Tratcher Feb 13, 2020
6f5c77f
Fix artifacts path
Tratcher Feb 13, 2020
e7dd879
Formatting
Tratcher Feb 13, 2020
651309f
Formatting
Tratcher Feb 13, 2020
e3fa3da
Test schedule, add test comments
Tratcher Feb 13, 2020
426cc0f
Clarify time zone
Tratcher Feb 13, 2020
a058c29
Disable test settings
Tratcher Feb 13, 2020
7d80e45
Update CODEOWNERS for shared runtime src
Tratcher Feb 13, 2020
402fa5c
Add ReportDiff.ps1
Tratcher Feb 19, 2020
16b0bca
ps1
Tratcher Feb 19, 2020
96107b2
Explore dir structure, move ps1
Tratcher Feb 19, 2020
cd8c7c1
Path fixup
Tratcher Feb 19, 2020
10aaf78
Revert path changes
Tratcher Feb 19, 2020
b7feaec
Path fixups
Tratcher Feb 19, 2020
bb005f1
Troubleshoot script path
Tratcher Feb 19, 2020
0ca6f13
Test local repo
Tratcher Feb 20, 2020
a9e25e8
Remove test fields
Tratcher Feb 20, 2020
5fa780d
Merge branch 'master' into master
Tratcher Feb 20, 2020
7d5391d
Set output changed variable
Tratcher Feb 24, 2020
fab739e
Auto-generate a PR
Tratcher Feb 24, 2020
4c16376
If syntax
Tratcher Feb 24, 2020
7f4a3df
Update runtime-sync.yml
Tratcher Feb 24, 2020
39b5d6d
Set changed?
Tratcher Feb 24, 2020
8176aaf
Drop if
Tratcher Feb 24, 2020
f799975
test fork
Tratcher Feb 24, 2020
83cbffd
return $changed
Tratcher Feb 24, 2020
3448fd4
Capture return value
Tratcher Feb 24, 2020
14b2999
Format echo
Tratcher Feb 24, 2020
c159280
Re-enable iff
Tratcher Feb 24, 2020
f3d8c08
Prep for PR
Tratcher Feb 24, 2020
a0d4a3c
Merge branch 'master' into master
Tratcher Feb 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ReportDiff.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Check the code is in sync
$changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0
if (-not $changed) { exit }
if (-not $changed) { return $changed }
# Check if tracking issue is open/closed
$Headers = @{ Authorization = 'token {0}' -f $ENV:GITHUB_TOKEN; };
$result = Invoke-RestMethod -Uri $issue
Expand All @@ -26,3 +26,4 @@ $diff
$json = ConvertTo-Json -InputObject @{ 'body' = $body }
$issue = $issue + '/comments'
$result = Invoke-RestMethod -Method POST -Headers $Headers -Uri $issue -Body $json
return $changed
19 changes: 17 additions & 2 deletions .github/workflows/runtime-sync.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: AspNetCore-Runtime Code Sync
on:
# Test this script using on: push
# push
# push:
schedule:
# * is a special character in YAML so you have to quote this string
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule
Expand Down Expand Up @@ -43,10 +43,25 @@ jobs:
name: results
path: artifacts
- name: Check and Notify
id: check
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Test this script using an issue in the local forked repo
$issue = 'https://github.com/api/repos/dotnet/aspnetcore/issues/18943'
.\aspnetcore\.github\workflows\ReportDiff.ps1
$changed = .\aspnetcore\.github\workflows\ReportDiff.ps1
echo "::set-output name=changed::$changed"
- name: Send PR
if: steps.check.outputs.changed == 'true'
# https://github.com/marketplace/actions/create-pull-request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: .\aspnetcore
commit-message: 'Sync shared code from runtime'
title: 'Sync shared code from runtime'
body: 'This PR was automatically generated to sync shared code changes from runtime. Fixes #18943'
labels: area-servers
branch: github-action/sync-runtime
branch-suffix: timestamp