Skip to content

fix: generate changelog at release time via artifact instead of direct push#189

Merged
elantiguamsft merged 1 commit intomainfrom
fix/changelog-at-release-time
Apr 6, 2026
Merged

fix: generate changelog at release time via artifact instead of direct push#189
elantiguamsft merged 1 commit intomainfrom
fix/changelog-at-release-time

Conversation

@JeromySt
Copy link
Copy Markdown
Member

@JeromySt JeromySt commented Apr 4, 2026

Problem

The create_changelog job 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-ruleset blocks direct pushes to main, even from GITHUB_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

  1. create_changelog generates CHANGELOG.md and uploads it as an artifact
  2. create_release downloads the artifact and uses it as the release body (body_path: ./CHANGELOG.md)

Changes

  • create_changelog: removed git commit/push; now uploads artifact instead
  • create_release: downloads changelog artifact; upgraded checkout to v4 with fetch-depth: 0 for tag discovery
  • Reduced create_changelog permissions to contents: read
  • Removed redundant fetch-and-checkout-main step

…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 elantiguamsft merged commit 40908bb into main Apr 6, 2026
12 checks passed
@elantiguamsft elantiguamsft deleted the fix/changelog-at-release-time branch April 6, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants