2022-10-15 20:09:57 +08:00
|
|
|
name: Update Vendor
|
|
|
|
|
|
|
|
on:
|
2022-10-15 20:18:13 +08:00
|
|
|
workflow_dispatch:
|
2022-10-15 20:09:57 +08:00
|
|
|
schedule:
|
|
|
|
# At 13:37 UTC every day.
|
|
|
|
- cron: '37 13 * * *'
|
2022-10-18 01:30:30 +08:00
|
|
|
|
2022-10-15 20:09:57 +08:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: pwsh
|
2022-10-18 01:30:30 +08:00
|
|
|
|
2022-10-15 20:09:57 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
vendor:
|
|
|
|
|
|
|
|
runs-on: windows-latest
|
|
|
|
continue-on-error: false
|
|
|
|
timeout-minutes: 15
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-10-18 01:30:30 +08:00
|
|
|
|
2022-10-15 20:09:57 +08:00
|
|
|
- run: |
|
2022-10-18 01:30:30 +08:00
|
|
|
$currentVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json)
|
|
|
|
. .\scripts\update.ps1 -verbose
|
2022-10-18 01:41:37 +08:00
|
|
|
Set-GHVariable -Name COUNT_UPDATED -Value $count
|
2022-10-18 01:30:30 +08:00
|
|
|
$newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json)
|
|
|
|
$listUpdated = ""
|
2022-10-18 02:21:35 +08:00
|
|
|
$updateMessage = "| Name | Old Version | New Version |`n| :--- | ---- | ---- |`n"
|
2022-10-18 01:32:53 +08:00
|
|
|
foreach ($s in $newVersion) {
|
2022-10-18 01:30:30 +08:00
|
|
|
$oldVersion = ($currentVersion | Where-Object {$_.name -eq $s.name}).version
|
|
|
|
if ($s.version -ne $oldVersion) {
|
|
|
|
$listUpdated += "$($s.name), "
|
2022-10-18 02:21:35 +08:00
|
|
|
$updateMessage += "| **$($s.name)** | $oldVersion | **$($s.version)**|`n"
|
2022-10-18 01:30:30 +08:00
|
|
|
}
|
|
|
|
}
|
2022-10-18 01:49:19 +08:00
|
|
|
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
|
2022-10-18 02:28:51 +08:00
|
|
|
Set-GHVariable -Name UPDATE_MESSAGE -Value $updateMessage.Replace("`n", "%0a")
|
2022-10-15 20:09:57 +08:00
|
|
|
|
|
|
|
- uses: peter-evans/create-pull-request@v4
|
|
|
|
with:
|
2022-10-18 01:30:30 +08:00
|
|
|
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
|
2022-10-18 02:21:35 +08:00
|
|
|
body: |
|
|
|
|
### Automatically updated `${{ env.COUNT_UPDATED }}` dependencies:
|
|
|
|
${{ env.UPDATE_MESSAGE }}
|
|
|
|
---
|
|
|
|
Please verify and then **Merge** the pull request to update.
|
2022-10-18 01:30:30 +08:00
|
|
|
commit-message: 'Update vendored dependencies (${{ env.LIST_UPDATED }})'
|
2022-10-15 20:09:57 +08:00
|
|
|
branch: update-vendor
|
|
|
|
base: master
|