runtime-sync.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: AspNetCore-Runtime Code Sync
  2. on:
  3. # Test this script using on: push
  4. # push:
  5. schedule:
  6. # * is a special character in YAML so you have to quote this string
  7. # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule
  8. # Once per day at midnight PST (8 UTC)
  9. - cron: '0 8 * * *'
  10. jobs:
  11. compare_repos:
  12. # Comment out this line to test the scripts in a fork
  13. if: github.repository == 'dotnet/aspnetcore'
  14. name: Compare the shared code in the AspNetCore and Runtime repos and notify if they're out of sync.
  15. runs-on: windows-latest
  16. steps:
  17. - name: Checkout aspnetcore
  18. uses: actions/[email protected]
  19. with:
  20. # Test this script using changes in a fork
  21. repository: 'dotnet/aspnetcore'
  22. path: aspnetcore
  23. - name: Checkout runtime
  24. uses: actions/[email protected]
  25. with:
  26. # Test this script using changes in a fork
  27. repository: 'dotnet/runtime'
  28. path: runtime
  29. - name: Copy
  30. shell: cmd
  31. working-directory: .\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\
  32. env:
  33. ASPNETCORE_REPO: d:\a\aspnetcore\aspnetcore\aspnetcore\
  34. run: CopyToAspNetCore.cmd
  35. - name: Diff
  36. shell: cmd
  37. working-directory: .\aspnetcore\
  38. run: |
  39. mkdir ..\artifacts
  40. git status > ..\artifacts\status.txt
  41. git diff > ..\artifacts\diff.txt
  42. - uses: actions/upload-artifact@v1
  43. with:
  44. name: results
  45. path: artifacts
  46. - name: Check and Notify
  47. id: check
  48. shell: pwsh
  49. env:
  50. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  51. run: |
  52. # Test this script using an issue in the local forked repo
  53. $issue = 'https://api.github.com/repos/dotnet/aspnetcore/issues/18943'
  54. $changed = .\aspnetcore\.github\workflows\ReportDiff.ps1
  55. echo "::set-output name=changed::$changed"
  56. - name: Send PR
  57. if: steps.check.outputs.changed == 'true'
  58. # https://github.com/marketplace/actions/create-pull-request
  59. uses: peter-evans/create-pull-request@v2
  60. with:
  61. token: ${{ secrets.GITHUB_TOKEN }}
  62. path: .\aspnetcore
  63. commit-message: 'Sync shared code from runtime'
  64. title: 'Sync shared code from runtime'
  65. body: 'This PR was automatically generated to sync shared code changes from runtime. Fixes #18943'
  66. labels: area-servers
  67. branch: github-action/sync-runtime
  68. branch-suffix: timestamp