Skip to content

CLA: fail closed when commits can't be read or a commit has no login - #20

Merged
pjhartlieb merged 1 commit into
devfrom
fix/cla-fail-closed
Nov 13, 2026
Merged

pjhartlieb merged 1 commit into
devfrom
fix/cla-fail-closed

Conversation

@pjhartlieb

Copy link
Copy Markdown
Contributor

Answers the two change requests on #19 (round 1 at d41dd9b). cla-reusable.yml's exemption step now stops for a maintainer instead of passing when:

  • the commits read fails or comes back short: the list is read into a variable and its line count must equal the pull request's commit count (a failure inside < <(...) was invisible to set -e, so a member's pull request came out all exempt);
  • a commit's author has no GitHub login: the action credits such a commit to its committer, who may be allowlisted or may already have signed;
  • the commit count isn't a positive number (inside if, a failed [ is just false).

The README row for cla-reusable.yml lists the new failure cases. Version stays 1.3.0 (not released).

Validation

Locally, at 9df238f:

$ pytest -q (pytest 9.0.3, ruff 0.15.10, as pinned)
72 passed
$ ruff check . && ruff format --check .
All checks passed!  5 files already formatted
$ actionlint 1.7.12 (shellcheck 0.11.0 on PATH)
(no output)
$ zizmor 1.30.1 (online) .
No findings to report. Good job! (2 ignored, 33 suppressed)

tests/test_cla_check.py adds 13 cases: a commit with no login (member and outside opener, [null], [null, m1], [m1, null], [ext, null]), a failed commits read, a short read, an empty read, and a commit count of null or 0. Against d41dd9b's workflow all 13 fail and the other 13 pass.

The round-1 verify-19.sh, cloning this commit instead of GitHub: d41dd9b gives 10 PASS, 2 FAIL (V06, V12); 9df238f gives V06 and V12 PASS. V11 reads CI on GitHub, so it is confirmed after push.

The commits are read into a variable and their count must match the pull
request's, so a failed or short read stops the step instead of leaving a
member's pull request all exempt. A commit whose author has no GitHub
login now stops the step for a maintainer: the action would credit it to
its committer. A commit count that isn't a positive number also stops it.
@pjhartlieb
pjhartlieb requested a review from a team as a code owner November 13, 2026 13:53
@pjhartlieb
pjhartlieb merged commit eff10b0 into dev Nov 13, 2026
14 checks passed
@pjhartlieb pjhartlieb mentioned this pull request Nov 13, 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