Files
dotnet__skills/.github/workflows/weekly-version-sync.yml
dependabot[bot] 1e2fc4f10e Bump the github-actions-dependencies group across 1 directory with 5 updates (#918)
Bumps the github-actions-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.2` | `7.0.0` |
| [actions/cache/restore](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [actions/cache](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [actions/setup-dotnet](https://github.com/actions/setup-dotnet) | `5.2.0` | `6.0.0` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.4.0` | `7.0.0` |



Updates `actions/checkout` from 6.0.2 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6.0.2...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

Updates `actions/cache/restore` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5.0.5...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

Updates `actions/cache` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/27d5ce7f107fe9357f9df03efb73ab90386fccae...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

Updates `actions/setup-dotnet` from 5.2.0 to 6.0.0
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7...a98b56852c35b8e3190ac28c8c2271da59106c68)

Updates `actions/setup-node` from 6.4.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/cache/restore
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-dotnet
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-20 17:01:55 -07:00

124 lines
4.9 KiB
YAML

# Weekly backstop. Computes every plugin's authoritative version on `main` with
# NBGV and, for any plugin whose content changed without a matching version bump,
# opens ONE pull request that stamps the correct versions and explains why.
#
# This is the safety net that makes per-PR bumping optional: anything a
# contributor or the /version-bump command missed is reconciled here. Running on
# main (post-merge) is the single source of truth, so the computed heights can
# never collide across PRs.
name: weekly-version-sync
on:
schedule:
- cron: '0 9 * * 1' # Mondays 09:00 UTC
workflow_dispatch:
concurrency:
group: weekly-version-sync
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
jobs:
sync:
# Never run on forks (avoids burning a fork owner's Actions minutes).
if: github.repository == 'dotnet/skills'
runs-on: ubuntu-latest
env:
SYNC_BRANCH: bot/weekly-version-sync
steps:
- name: Checkout main
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
with:
fetch-depth: 0
persist-credentials: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v5
with:
# nbgv targets net8.0; global.json pins an SDK that ships only a preview runtime, onto
# which a release-targeted tool will not roll forward. Install an 8.0.x runtime so nbgv
# has a runtime to execute on, alongside the global.json SDK.
dotnet-version: '8.0.x'
global-json-file: global.json
- name: Restore tools
run: dotnet tool restore --configfile eng/version/nuget.config
- name: Compute and stamp versions
id: stamp
shell: pwsh
run: |
# Authoritative compute on main HEAD; write drifted plugins in place.
$report = & "$PWD/eng/version/Sync-PluginVersions.ps1" -OnlyChanged -Write | ConvertFrom-Json
if (-not $report -or $report.Count -eq 0) {
"has_changes=false" >> $env:GITHUB_OUTPUT
"No plugin versions drifted — nothing to sync." >> $env:GITHUB_STEP_SUMMARY
exit 0
}
# Build the PR body, explaining each bump with the commits that caused it.
$sections = foreach ($r in $report) {
$name = $r.plugin
$lastStamp = git log -1 --format='%H' -- "plugins/$name/plugin.json"
$range = if ($lastStamp) { "$lastStamp..HEAD" } else { 'HEAD' }
$commits = git log --format='- %h %s' $range -- "plugins/$name" `
":(exclude)plugins/$name/plugin.json" `
":(exclude)plugins/$name/.codex-plugin/plugin.json" `
":(exclude)plugins/$name/.claude-plugin/plugin.json"
$why = if ($commits) { ($commits -join "`n") } else { '- (no attributable commits found)' }
@(
"### ``$name``: $($r.current) → $($r.computed)"
""
"Changes since the last version bump:"
""
$why
""
) -join "`n"
}
$body = @(
"Automated weekly version sync. The following plugins changed since their"
"last version bump; this PR stamps the NBGV-computed version into their"
"``plugin.json`` and ``.codex-plugin/plugin.json`` (and ``.claude-plugin/plugin.json``"
"where a plugin has one)."
""
"Patch numbers are derived from git history — review the reasons below, then merge."
""
($sections -join "`n")
) -join "`n"
Set-Content -Path pr-body.md -Value $body
"has_changes=true" >> $env:GITHUB_OUTPUT
$body >> $env:GITHUB_STEP_SUMMARY
- name: Open or update sync PR
if: steps.stamp.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -c "$SYNC_BRANCH"
git add plugins/*/plugin.json plugins/*/.codex-plugin/plugin.json
# The optional Claude manifest may match zero plugins in the future; keep this add
# non-fatal so an empty glob can't fail the step.
git add plugins/*/.claude-plugin/plugin.json 2>/dev/null || true
git commit -m "Weekly plugin version sync"
git push --force origin "$SYNC_BRANCH"
EXISTING=$(gh pr list --head "$SYNC_BRANCH" --state open --json number --jq '.[0].number // empty')
if [[ -n "$EXISTING" ]]; then
gh pr edit "$EXISTING" --body-file pr-body.md
echo "Updated existing PR #$EXISTING"
else
gh pr create \
--base main \
--head "$SYNC_BRANCH" \
--title "Weekly plugin version sync" \
--body-file pr-body.md
fi