Skip to content

Handle Copilot commit identity mismatch in DCO exemptions#94

Merged
bingenito merged 4 commits into
mainfrom
copilot/pr-856-dco-check-issue
Jun 29, 2026
Merged

Handle Copilot commit identity mismatch in DCO exemptions#94
bingenito merged 4 commits into
mainfrom
copilot/pr-856-dco-check-issue

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

DCO checks were failing for Copilot-generated commits because exemption matching only used commit.author.login, while these commits can surface as Copilot login with bot-style commit author names. This update broadens exemption matching to cover both identity sources used by GitHub payloads.

  • Problem

    • Exemption logic relied on commit.author.login only.
    • Copilot-authored commits in PR #856 resolved to Copilot at login-level, so existing copilot-swe-agent[bot] allow-list entries did not apply.
  • Workflow updates

    • Extended ALLOWED_USERS with additional Copilot login variants (copilot, Copilot) for compatibility.
    • Updated exemption condition to match against both:
      • commit.author.login
      • commit.commit.author.name (null-safe access chain)
  • Behavioral impact

    • Bot/app-authored commits with mismatched login vs commit-author-name no longer fail DCO due to identity normalization differences.
    • Existing DCO enforcement path for non-exempt commits is unchanged.
const githubUsername = commit.author ? commit.author.login : "";
const commitAuthorName = commit?.commit?.author?.name || "";

const isAllowedUser =
  allowedUsers.includes(githubUsername) ||
  allowedUsers.includes(commitAuthorName);

@bingenito
bingenito marked this pull request as ready for review June 24, 2026 11:43
Copilot AI review requested due to automatic review settings June 24, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the DCO-check GitHub Actions workflow to better exempt Copilot/bot-authored commits when GitHub’s API surfaces differing identities for the same commit.

Changes:

  • Extend the ALLOWED_USERS env list with additional Copilot login variants (copilot, Copilot).
  • Broaden exemption matching logic beyond commit.author.login by adding a second identity source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/dco-check.yml Outdated
Comment thread .github/workflows/dco-check.yml Outdated
bingenito and others added 2 commits June 29, 2026 07:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bingenito
bingenito merged commit 08d0d56 into main Jun 29, 2026
1 check passed
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.

3 participants