Skip to content

Only comment when someone needs to sign the CLA - #7

Open
bkeepers wants to merge 2 commits into
masterfrom
comment-only-when-unsigned
Open

bkeepers wants to merge 2 commits into
masterfrom
comment-only-when-unsigned

Conversation

@bkeepers

@bkeepers bkeepers commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

The action comments on a pull request only when someone still needs to sign. When everyone has already signed, it posts nothing and the cla check or status reports the result. A new comment-when-signed input, false by default, brings back the all-signed comment when set to true.

This is a compatibility change: workflows that bump to this version stop getting a comment on pull requests whose contributors have all signed, including any custom-allsigned-prcomment text, unless they set comment-when-signed: true.

By default:

  • A pull request whose contributors have all signed gets no comment.
  • A pull request with unsigned contributors gets the usual request to sign.
  • A comment the action already posted is still updated, so a "please sign" comment turns into "all signed" once people sign.
  • An opener mismatch is still posted, even when everyone has signed. It either explains why the check failed or, with require-opener-as-author: false, flags an opener who isn't a commit author.

The change is in src/pullrequest/pullRequestComment.ts, with the input in action.yml and src/shared/getInputs.ts, and documented in the README and CHANGELOG. dist/index.js is rebuilt.

Tests

Unit tests in __tests__/unit/pullRequestComment.test.ts cover each case above and the opt-in. __tests__/integration/scenarios.test.ts runs an already-signed contributor through the whole action with and without the input. Tests that checked the all-signed comment now set comment-when-signed: true. The full suite (185 passed, 1 skipped) and npm run lint pass locally.

Known limitations

  • When a repository has no signatures file yet and every committer is allowlisted, the action throws "have to sign" on its first run, and by default that run posts no comment. The throw predates this change. Every Open Waters repository using the action already has .cla.json, and their workflows skip Dependabot.
  • No test checks the bundled action against the action.yml default. The unit tests use the code's fallback, which matches it.

After merge

Bump the pinned commit in cla.yml and actions.lock in each repository that uses the action. No input needs setting.

  • openwatersio/stillwell
  • openwatersio/OpenWaters
  • openwatersio/aiscast
  • openwatersio/slackwater-ios
  • openwatersio/slackwater-android

Review

Round 1: Codex, Claude Opus, and Claude Sonnet reviewed the opt-in version of the input against master. Copilot didn't run because its monthly quota was used up. No correctness defects. Fixed: the code comment on the opener-mismatch exception, the CHANGELOG wording, and missing tests for a non-failing opener mismatch and for updating an existing comment.

Round 2: Opus and Sonnet reviewed the switch to a false default. No code defects. Fixed: the custom-allsigned-prcomment docs, which didn't say it now posts only on an existing comment by default, and a test title. The missing bundle-default test is listed under known limitations.

All reviews were static. The test suite and lint ran locally after the last fixes, which touched only docs and tests.

Set it to false to post a comment only when someone still needs to sign,
and rely on the check or status otherwise. An existing comment is still
updated, and an opener mismatch is still posted.
The action no longer comments on a pull request whose contributors have
all signed; the check or status reports the result. Set
comment-when-signed: true to keep the all-signed comment.
@bkeepers bkeepers changed the title Skip the CLA comment when everyone has signed Only comment when someone needs to sign the CLA Nov 30, 2026
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.

1 participant