Skip to content

Output the contributors as JSON - #304

Open
obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:add/contributors-output
Open

obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:add/contributors-output

Conversation

@obenland

Copy link
Copy Markdown
Member

See #242.

This is the structured-output half of #242. Workflows that build their own credits, such as release notes or a readme's contributor list, had to parse the rendered comment to get at the accounts. The new contributors output gives them the list as JSON:

[
  { "github": "octocat", "email": null, "wporg": "octo" },
  { "github": null, "email": "co-author@git.wordpress.org", "wporg": "co-author" },
  { "github": null, "email": "someone@example.com", "wporg": null },
  { "github": "newcomer", "email": null, "wporg": null }
]
  • Entries come in the order the comment credits them, after @propsbot add and remove commands are applied.
  • email is set only for commit authors GitHub can't match to an account. wporg is null for anyone without a linked WordPress.org account, matching the comment's unlinked list.
  • The output is set before the comment is posted, so it's there even when posting fails. It's an empty array when there are no contributors.

Each contributor is listed once, under the first way they contributed, which is how the collector already dedupes them. That's why there are no per-contributor roles, which #242 suggested: adding them would mean changing the collector to keep every role.

The release-aggregation mode from #242 isn't part of this PR.

Testing

  1. In a workflow, read it with fromJSON( steps.<id>.outputs.contributors ).
  2. Check the list against the props comment.

🤖 Generated with Claude Code

Workflows that build their own credits, like release notes or a readme's
contributor list, had to parse the rendered comment to get at the accounts.
The new `contributors` output lists each contributor's GitHub username,
commit email when there is no GitHub account, and WordPress.org username.

See WordPress#242.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 23, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

2 participants