Repository navigation
ci: credit original authors of mirrored external PRs in changelogs - #3496
Merged
Merged
Conversation
|
shrey150
marked this pull request as ready for review
November 19, 2026 22:38
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Architecture diagram
sequenceDiagram
participant Changesets as Changesets CLI
participant Wrapper as .changeset/changelog.cjs
participant Base as @changesets/changelog-github
participant GHAPI as GitHub API
Note over Changesets,GHAPI: Release changelog generation flow
Changesets->>Wrapper: getReleaseLine(changeset, type, options)
alt Changeset has existing overrides or no commit
Wrapper-->>Changesets: Passthrough (unchanged)
else Mirrored PR detected
Wrapper->>GHAPI: GET /repos/{repo}/commits/{commit}/pulls
GHAPI-->>Wrapper: PR list
alt PR authored by github-actions[bot] with marker
Wrapper->>GHAPI: GET /repos/{repo}/pulls/{source}
GHAPI-->>Wrapper: Original PR details
Wrapper->>Wrapper: Build overrides (pr, commit, author)
Wrapper->>Base: getReleaseLine(creditedChangeset)
Base-->>Wrapper: Release line
Wrapper-->>Changesets: Release line with original author
else Non-mirrored PR
Wrapper->>Base: getReleaseLine(original changeset)
Base-->>Wrapper: Release line
Wrapper-->>Changesets: Release line (unchanged)
end
end
Note over Wrapper,GHAPI: Error handling path
Wrapper->>GHAPI: GitHub API call
alt API failure or missing data
GHAPI-->>Wrapper: Error / empty response
Wrapper->>Wrapper: Log warning
Wrapper->>Base: getReleaseLine(original changeset)
Base-->>Wrapper: Release line
Wrapper-->>Changesets: Release line (default credit)
end
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
sameelarif
approved these changes
Nov 20, 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.
Changesets merged through a mirrored external contributor PR currently show
Thanks @github-actions!in release notes, because the mirror PR is authored by the bot.This wraps
@changesets/changelog-githubin.changeset/changelog.cjs. For each changeset, if its commit came from a merged PR authored bygithub-actions[bot]that carries theexternal-contributor-pr:owned source-pr=marker, it addspr:,commit:andauthor:overrides pointing at the original PR and its author (read from the GitHub API, not from the PR body text). Changesets that already have overrides, and every non-mirrored PR, are left unchanged.Checked locally against the three pending mirrored changesets (#3463, #3422, #3465 now credit their authors) and a regular PR (#3450 is unchanged).
If a GitHub lookup fails, the wrapper logs a warning and falls back to the default credit, so it can't block a release PR.
Dry run (Nov 19) against the live repo with
@changesets/changelog-github0.7.0:empty-response-header-valuesnow credits #3422 / @aryansahai22,host-only-cookie-matchingcredits #3465 / @Kelvin-Waititu, a regular changeset (eve-1-0-upgrade, #3409) is unchanged, and a simulated API failure falls back to the default line.No tests added: the failure mode is attribution in release notes, not publishing, and the release PR diff shows the output before anything ships.
Summary by cubic
Fixes release notes so changesets merged through mirrored external contributor PRs credit the original author instead of
github-actions[bot].@changesets/changelog-githubin.changeset/changelog.cjsto detect mirrored PRs via theexternal-contributor-pr:ownedmarker and addpr:,commit:, andauthor:overrides from the GitHub API.Written for commit 72b02d0. Summary will update on new commits.