Accept a CLA signature that has line breaks after it

The CLA job only ran for a comment exactly equal to the signing phrase.
@JensS signed on #1792 with the phrase followed by line breaks
("...sign the CLA\r\n\r\n\n"), the comparison failed, the job was
skipped, and the signature was never recorded, so all three of his pull
requests still show the CLA as unsigned.

The action itself matches the phrase loosely. The filter in front of it
now does too: contains() for the signature, startsWith() for recheck,
both case-insensitive. It still keeps the job off ordinary comments,
which is what it is there for.
This commit is contained in:
ignacionelson
2026-09-21 18:21:04 -03:00
parent 3a3fd5358d
commit 0a7330d5cd
+10 -2
View File
@@ -41,11 +41,19 @@ jobs:
# `issue.pull_request` is present only when the comment is on a pull # `issue.pull_request` is present only when the comment is on a pull
# request; comments on ordinary issues have nothing for this action to # request; comments on ordinary issues have nothing for this action to
# check. # check.
#
# Loose on purpose, never `==`. The action matches the signing phrase
# loosely itself -- any case, anything around it -- and this filter has
# to be at least as forgiving, or it throws away signatures the action
# would have accepted. It did: a contributor's signature arrived with
# trailing line breaks ("...sign the CLA\r\n\r\n"), the exact match
# skipped the job, and nothing was recorded. `contains` and
# `startsWith` ignore case here as well.
if: >- if: >-
github.event_name == 'pull_request_target' github.event_name == 'pull_request_target'
|| (github.event.issue.pull_request || (github.event.issue.pull_request
&& (github.event.comment.body == 'recheck' && (startsWith(github.event.comment.body, 'recheck')
|| github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA')) || contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA')))
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: CLA check - name: CLA check