cmder/.github/workflows/vendor.yml
dependabot[bot] 457d99da0b
Bump peter-evans/create-pull-request from 5 to 6 (#2918)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 19:43:13 +00:00

66 lines
2.1 KiB
YAML

name: Update Vendor
on:
workflow_dispatch:
schedule:
# At 13:37 UTC every day.
- cron: '37 13 * * *'
defaults:
run:
shell: pwsh
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@v4
with:
fetch-depth: 0
- id: make-changes
name: Checking for updates
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$currentVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json)
. .\scripts\update.ps1 -verbose
Set-GHVariable -Name COUNT_UPDATED -Value $count
$newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json)
$listUpdated = ""
$updateMessage = "| Name | Old Version | New Version |`n| :--- | ---- | ---- |`n"
foreach ($s in $newVersion) {
$oldVersion = ($currentVersion | Where-Object {$_.name -eq $s.name}).version
if ($s.version -ne $oldVersion) {
$repoUrl = ($repoUrl = $s.Url.Replace("/archive/", "/releases/")).Substring(0, $repoUrl.IndexOf("/releases/")) + "/releases"
$listUpdated += "$($s.name) v$($s.version), "
$updateMessage += "| **[$($s.name)]($repoUrl)** | $oldVersion | **$($s.version)** |`n"
}
}
if ($count -eq 0) { return }
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
echo "UPDATE_MESSAGE<<<EOF`n$updateMessage`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- uses: peter-evans/create-pull-request@v6
if: env.COUNT_UPDATED > 0
with:
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
body: |
### Automatically updated `${{ env.COUNT_UPDATED }}` dependencies:
${{ env.UPDATE_MESSAGE }}
---
Please verify and then **Merge** the pull request to update.
commit-message: '⬆️ Update dependencies (${{ env.LIST_UPDATED }})'
branch: update-vendor
base: master