Skip to content

Commit cf5625a

Browse files
committed
fix(changelog): find original author of agentic commits
fix(changelog): make co-authors first-class authors; keep all contributors Addresses the Copilot review on PR #39: - Co-authors overwrite (utils.js): instead of storing co-authors in a per-author field that a later commit could overwrite, every `Co-authored-by` trailer now becomes a first-class entry in the authors map (keyed by login). This drops co-authors no more, regardless of how many commits an author has, and works whether or not Slack IDs are fetched. getCommitCoauthors now returns { login, name, email }. - getAuthorsWithSlackIds no longer drops contributors. Restored to the documented contract (action.yml / PR description): return every author and attach `slackId` only when it can be resolved, rather than filtering out anyone without an org email or Slack match. Rebuilt dist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvWuyXuTp7HFAExnfjG91b feat(changelog): exclude bots and ignored logins from authors Adds bot/author filtering so release notifications don't tag automation accounts (Copilot, Claude) while still crediting the real humans behind their commits: - Commit authors with GitHub account type "Bot" are always skipped. - New `ignore-authors` input (comma-separated logins, default "Copilot,Claude", matched case-insensitively) excludes both commit authors and `Co-authored-by` trailers. A bot commit's real co-authors are still kept. Rebuilt dist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvWuyXuTp7HFAExnfjG91b fix(changelog): find original author of agentic commits
1 parent 291951c commit cf5625a

6 files changed

Lines changed: 260 additions & 130 deletions

File tree

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ inputs:
5050
github-org-token:
5151
required: false
5252
description: 'Github token with read:org scope to access Apify org members. Needed to map commit authors onto Slack IDs.'
53+
ignore-authors:
54+
required: false
55+
default: 'Copilot,Claude'
56+
description: >-
57+
Comma-separated list of GitHub logins to exclude from the changelog authors (matched case-insensitively).
58+
Applies to both commit authors and `Co-authored-by` trailers.
59+
GitHub bot accounts (type "Bot") are always excluded regardless of this list.
5360
outputs:
5461
github-changelog:
5562
description: 'Changelog content in GihHub markdown'

dist/index.js

Lines changed: 91 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const {
1313
getReleaseNameInfo,
1414
createGithubReleaseFn,
1515
sendReleaseNotesToSlack,
16+
parseIgnoredAuthors,
1617
} = require('./utils');
1718

1819
/**
@@ -38,6 +39,7 @@ function alreadyExistsExit(alreadyExists, releaseName) {
3839
* @param {*} context - github action context
3940
* @param {string} baseBranch - base branch/commit to start comparison from
4041
* @param {string} headBranch - head branch/commit to start comparison from
42+
* @param {Set<string>} ignoredAuthors - normalized (lower-cased) logins to exclude from authors
4143
* @returns {Promise<{ changelog: string, authors: array<{ name: string, email: string, login: string }>, includedPrNumbers: number[] }>}
4244
*/
4345
async function createChangelog(
@@ -47,6 +49,7 @@ async function createChangelog(
4749
context,
4850
baseBranch,
4951
headBranch,
52+
ignoredAuthors = new Set(),
5053
) {
5154
let changelog;
5255
let authors = [];
@@ -57,13 +60,15 @@ async function createChangelog(
5760
changelog = await getChangelogFromPullRequestDescription(octokit, context);
5861
break;
5962
case 'pull_request_commits':
60-
({ changelog, authors, includedPrNumbers } = await getChangelogFromPullRequestCommits(octokit, scopes, context));
63+
({ changelog, authors, includedPrNumbers } = await getChangelogFromPullRequestCommits(octokit, scopes, context, ignoredAuthors));
6164
break;
6265
case 'pull_request_title':
6366
({ changelog, includedPrNumbers } = await getChangelogFromPullRequestTitle(octokit, scopes, context));
6467
break;
6568
case 'commits_compare':
66-
({ changelog, authors, includedPrNumbers } = await getChangelogFromCompareBranches(octokit, context, baseBranch, headBranch, scopes));
69+
({ changelog, authors, includedPrNumbers } = await getChangelogFromCompareBranches(
70+
octokit, context, baseBranch, headBranch, scopes, ignoredAuthors,
71+
));
6772
break;
6873
default:
6974
core.error(`Unrecognized "changelog-method" input: ${method}`);
@@ -89,6 +94,7 @@ async function run() {
8994
const slackChannel = core.getInput('slack-channel');
9095
const githubChangelogFileDestination = core.getInput('github-changelog-file-destination');
9196
const fetchAuthorSlackIds = core.getBooleanInput('fetch-author-slack-ids');
97+
const ignoredAuthors = parseIgnoredAuthors(core.getInput('ignore-authors'));
9298

9399
const octokit = github.getOctokit(githubToken);
94100
const context = {
@@ -127,6 +133,7 @@ async function run() {
127133
context,
128134
baseBranch,
129135
headBranch,
136+
ignoredAuthors,
130137
);
131138

132139
if (createReleasePullRequest) {

0 commit comments

Comments
 (0)