Update CHANGELOG.md when syncing plugin content to marketplace repos#1908
Update CHANGELOG.md when syncing plugin content to marketplace repos#1908
Conversation
Agent-Logs-Url: https://github.com/microsoft/GitHub-Copilot-for-Azure/sessions/d33e0934-f0be-40fc-9bbf-ad71cbe507b0 Co-authored-by: fanyang-mono <52458914+fanyang-mono@users.noreply.github.com>
| /^## \[/ && !inserted { | ||
| print "## [" ver "] - " date | ||
| print "" | ||
| print "### Changed" |
There was a problem hiding this comment.
@copilot Add what actually change in CHANGELOG.md instead of this generic message.
There was a problem hiding this comment.
Done in commit 4707c63. The script now reads git diff --cached --name-status to build the actual change list, producing entries like:
## [1.0.2] - 2026-04-16
### Changed
- Updated: `skills/azure-deploy/SKILL.md`
- Added: `skills/azure-upgrade/SKILL.md`
- Removed: `skills/old-skill/SKILL.md`The generic message is kept only as a fallback when no relevant staged files are found.
Agent-Logs-Url: https://github.com/microsoft/GitHub-Copilot-for-Azure/sessions/22a999e4-92f1-494a-9b19-fe29d13b5787 Co-authored-by: fanyang-mono <52458914+fanyang-mono@users.noreply.github.com>
jongio
left a comment
There was a problem hiding this comment.
Two issues worth catching before this merges:
- Job 2 (microsoft/azure-skills) will produce duplicate changelog lines because that sync fans files out to both
.github/plugins/azure-skills/and the repo root, and both sets end up staged. - Renames from
git diff --cached --name-statusaren't parsed correctly.
Details inline.
|
|
||
| # Update CHANGELOG.md with new version entry | ||
| bash "../source-repo/.github/scripts/update-changelog.sh" \ | ||
| ".github/plugins/azure-skills/CHANGELOG.md" "$NEW_VERSION" |
There was a problem hiding this comment.
Job 2 copies plugin files into .github/plugins/azure-skills/ AND to the repo root (see the "Copy plugin files to repo root" step earlier in this job). Both sets land in git add --all, so git diff --cached --name-status returns each file twice: once under .github/plugins/azure-skills/skills/foo/SKILL.md (which the script strips to skills/foo/SKILL.md) and once at the root path skills/foo/SKILL.md. The changelog entry will list every file twice.
Either dedupe in the script (associative array keyed by final relpath) or scope the diff to .github/plugins/azure-skills/ before feeding the script.
|
|
||
| # Fall back to a generic message when no specific changes were found. | ||
| if [ ${#CHANGE_LINES[@]} -eq 0 ]; then | ||
| CHANGE_LINES=("- Synced plugin files from GitHub-Copilot-for-Azure.") |
There was a problem hiding this comment.
git diff --cached --name-status emits renames as R<score>\told\tnew (three tab-separated fields). With IFS=$'\t' read -r status filepath the filepath variable swallows both old and new (with the tab between them), producing an entry that contains an embedded tab. rsync doesn't produce renames in the current sync flow so it's low-probability, but it'll misbehave if someone restructures plugin paths. read -r status filepath newpath with a rename branch would cover it.
The
publish-to-marketplace.ymlworkflow bumps the plugin version on content changes but never updatedCHANGELOG.mdin the target repos (microsoft/skillsandmicrosoft/azure-skills), leaving version history undocumented.Changes
.github/scripts/update-changelog.sh(new)Shared script called by both sync jobs to insert a new versioned entry into the target repo's
.github/plugins/azure-skills/CHANGELOG.md:## [section; appends at end if none foundgit diff --cached --name-status, listing each file as Added, Updated, or Removed with its path relative to the plugin rootawkoutput is non-empty before replacing the original.github/workflows/publish-to-marketplace.ymlBoth "Bump version if content changed" steps now call the shared script when
HAS_CONTENT_CHANGES=true, so the CHANGELOG update is included in the same commit as the version bump:The resulting entry reflects the actual sync changes: