Skip to content

Conversation

Copy link

Copilot AI commented Nov 4, 2025

CLA approvals were failing when users added trailing punctuation to their agreement comment (e.g., "I have hereby read the F5 CLA and agree to its terms."). The workflow used exact string matching which rejected natural variations.

Changes

  • Added normalization step that runs on issue_comment events to strip leading/trailing whitespace and trailing punctuation (.!?;,) before matching
  • Restructured workflow condition to check pull_request_target events first, then normalized output for issue_comment events (avoids accessing undefined step outputs)
  • Secured input handling using environment variables and printf instead of direct interpolation to prevent shell injection
  • Updated documentation in README and CHANGELOG to reflect the normalization behavior

Implementation

- name: Normalize comment body
  id: normalize
  if: github.event_name == 'issue_comment'
  env:
    COMMENT_BODY: ${{ github.event.comment.body }}
  run: |
    NORMALIZED=$(printf '%s\n' "$COMMENT_BODY" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//; s/[.!?;,]*$//')
    echo "normalized=$NORMALIZED" >> "$GITHUB_OUTPUT"

- name: Run F5 CLA assistant
  if: |
    github.event_name == 'pull_request_target' ||
    (github.event_name == 'issue_comment' &&
     (steps.normalize.outputs.normalized == 'recheck' ||
      steps.normalize.outputs.normalized == 'I have hereby read the F5 CLA and agree to its terms'))

Backward compatible—comments without punctuation continue to work unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>CLA approvals fail when users add a period to the end of a sentence</issue_title>
<issue_description>### Bug Overview

Example: nginx/documentation#512

Expected Behavior

When the user signs the CLA in a reasonable way, the CLA test accepts it

Steps to Reproduce the Bug

  1. New user
  2. The user submits a PR
  3. The user signs the CLA, and adds a period to the end of the sentence.

Environment Details

GitHub UI

Additional Context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

@alessfg There is not much we can do about this since from what I can tell, the signature message parameter does not allow a regex. @alessfg The CLA action does not allow multiple answers sadly... We need to figure out if there's a way to do some level of regex handling before the proper CLA action runs.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix CLA approval failure with period at end of sentence Normalize CLA comment text to handle trailing punctuation Nov 4, 2025
Copilot AI requested a review from alessfg November 4, 2025 14:11
Copilot finished work on behalf of alessfg November 4, 2025 14:11
Copy link
Member

@TasoOneAsia TasoOneAsia left a comment

Choose a reason for hiding this comment

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

Logic looked okay aside from one comment.

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.

CLA approvals fail when users add a period to the end of a sentence

3 participants