Skip to content

Commit 41b011b

Browse files
committed
Spec cleanup: remove orphan input, declare output, sync README
Four inconsistencies found while reviewing the spec surface after the recent opener-mismatch work: 1. The [!CAUTION] block in the bot comment named the upstream project ('contributor-assistant/github-action') as the step to configure. This repo is a fork (iainmcgin/cla-github-action), and any other downstream will have a different step name. Replace with generic 'CLA-assistant step' so the guidance stays accurate regardless of who consumes the action. 2. action.yml still declared the 'signed-empty-commit-message' input. No handler in src/ reads it, and the empty-commit feature it paired with was removed in the earlier Phase 7 cleanup. Drop it. 3. The action emits core.setOutput('opener_not_in_commits', true) at runtime but did not declare it in action.yml's (previously absent) outputs section. Add the outputs: block so maintainers can see the contract and downstream steps can reference it in workflow expressions like steps.cla.outputs.opener_not_in_commits. 4. The README Inputs Description table was missing both the new require-opener-as-author row and the pre-existing use-dco-flag row (the latter is in action.yml since forever but never made it to the README). Added both, plus a new 'Outputs' section for the output declared in (3).
1 parent db23684 commit 41b011b

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ This PAT should have repo scope and is only required if you have configured to s
143143
| `custom-allsigned-prcomment` | _optional_ | pull request comment when everyone has signed | All Contributors have signed the CLA. |
144144
| `lock-pullrequest-aftermerge` | _optional_ | Boolean input for locking the pull request after merging. Default is set to `true`. It is highly recommended to lock the Pull Request after merging so that the Contributors won't be able to revoke their signature comments after merge | false |
145145
| `suggest-recheck` | _optional_ | Boolean input for indicating if the action's comment should suggest that users comment `recheck`. Default is set to `true`. | false |
146+
| `use-dco-flag` | _optional_ | Boolean input. Set to `true` to run the action in DCO (Developer Certificate of Origin) mode instead of CLA mode. The bot's prompts and persistence logic use DCO wording. Default is `false`. | true |
147+
| `require-opener-as-author` | _optional_ | Boolean input. When `true` (the default), fail the check if the Pull Request opener is not recorded as an author or co-author of any commit. Guards against an attacker opening a PR whose commits are attributed to an identity they do not control. Set to `false` for workflows that legitimately involve submitting commits authored by others (cherry-picks, release-engineering patch submission, mailing-list-style contribution). | false |
148+
149+
### Outputs
150+
151+
| Name | Description |
152+
| --------------------- | ----------- |
153+
| `opener_not_in_commits` | Set to `'true'` when the Pull Request opener is not recorded as an author or co-author of any commit in the PR. Emitted regardless of whether `require-opener-as-author` caused the check to fail. |
146154

147155
## Contributors
148156

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ inputs:
2222
description: "Fully qualified web link to the document - example: https://github.com/cla-assistant/github-action/blob/master/SAPCLA.md"
2323
signed-commit-message:
2424
description: "Commit message when a new contributor signs the CLA in a PR"
25-
signed-empty-commit-message:
26-
description: "Commit message when a new contributor signs the CLA (empty)"
2725
create-file-commit-message:
2826
description: "Commit message when a new file is created"
2927
custom-notsigned-prcomment:
@@ -51,6 +49,14 @@ inputs:
5149
others (cherry-picks, release-engineering patch submission, mailing-list
5250
style contribution workflows).
5351
default: "true"
52+
outputs:
53+
opener_not_in_commits:
54+
description: >
55+
Set to 'true' when the Pull Request opener is not recorded as an author
56+
or co-author of any commit in the PR. Emitted regardless of whether
57+
'require-opener-as-author' caused the check to fail, so repositories
58+
can gate additional workflows (e.g. branch protection rules) on this
59+
output independently of the CLA-check pass/fail.
5460
runs:
5561
using: "node24"
5662
main: 'dist/index.js'

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31051,7 +31051,7 @@ function renderOpenerMismatchBlock(mismatch) {
3105131051
> - Opener: @${mismatch.opener}
3105231052
> - Commit authors: ${authorList}
3105331053
>
31054-
> This check is blocked to guard against commits being submitted under a trusted identity the submitter does not control. If this PR is a legitimate cherry-pick, release-engineering submission, or mailing-list-style patch delivery, the repository maintainer can opt out of this check by setting \`require-opener-as-author: 'false'\` on the \`contributor-assistant/github-action\` step in the repository's workflow.
31054+
> This check is blocked to guard against commits being submitted under a trusted identity the submitter does not control. If this PR is a legitimate cherry-pick, release-engineering submission, or mailing-list-style patch delivery, the repository maintainer can opt out of this check by setting \`require-opener-as-author: 'false'\` on the CLA-assistant step in the repository's workflow.
3105531055

3105631056
`;
3105731057
}

src/pullrequest/pullRequestCommentContent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function renderOpenerMismatchBlock(mismatch: {
115115
> - Opener: @${mismatch.opener}
116116
> - Commit authors: ${authorList}
117117
>
118-
> This check is blocked to guard against commits being submitted under a trusted identity the submitter does not control. If this PR is a legitimate cherry-pick, release-engineering submission, or mailing-list-style patch delivery, the repository maintainer can opt out of this check by setting \`require-opener-as-author: 'false'\` on the \`contributor-assistant/github-action\` step in the repository's workflow.
118+
> This check is blocked to guard against commits being submitted under a trusted identity the submitter does not control. If this PR is a legitimate cherry-pick, release-engineering submission, or mailing-list-style patch delivery, the repository maintainer can opt out of this check by setting \`require-opener-as-author: 'false'\` on the CLA-assistant step in the repository's workflow.
119119
120120
`
121121
}

0 commit comments

Comments
 (0)