fix: generate changelog at release time via artifact instead of direct push#189
Merged
elantiguamsft merged 1 commit intomainfrom Apr 6, 2026
Merged
Conversation
…t push The org-level branch protection ruleset (microsoft-production-ruleset) blocks direct pushes to main, even from GITHUB_TOKEN. This caused create_changelog to fail on every push to main. Changes: - create_changelog now generates CHANGELOG.md and uploads it as a workflow artifact (no git commit/push). - create_release downloads the changelog artifact and uses it for the release body (body_path: ./CHANGELOG.md). - Upgraded checkout to v4 with fetch-depth: 0 for full tag history. - Removed the separate fetch-and-checkout-main step (redundant with checkout@v4 ref: main + fetch-depth: 0). - Reduced create_changelog permissions to contents: read. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
elantiguamsft
approved these changes
Apr 4, 2026
NN2000X
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
create_changelogjob fails on every push to main with:remote: - Changes must be made through a pull request. ! [remote rejected] main -> main (push declined due to repository rule violations)The org-level
microsoft-production-rulesetblocks direct pushes tomain, even fromGITHUB_TOKEN. This means the changelog cannot be committed directly to main from a workflow.Solution
Generate the changelog as a workflow artifact and pass it to
create_release— no direct push needed.Flow
create_changeloggeneratesCHANGELOG.mdand uploads it as an artifactcreate_releasedownloads the artifact and uses it as the release body (body_path: ./CHANGELOG.md)Changes
create_changelog: removed git commit/push; now uploads artifact insteadcreate_release: downloads changelog artifact; upgraded checkout to v4 withfetch-depth: 0for tag discoverycreate_changelogpermissions tocontents: read