Skip to content
17 changes: 16 additions & 1 deletion .github/workflows/f5_cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,23 @@ jobs:
pull-requests: write
statuses: write
steps:
- name: Normalize comment body
id: normalize
if: github.event_name == 'issue_comment'
shell: bash
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
# Normalize the comment by trimming whitespace and removing trailing punctuation
# Remove leading/trailing whitespace and trailing punctuation marks
NORMALIZED=$(printf '%s\n' "$COMMENT_BODY" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//; s/[.!?;,]*$//')
echo "normalized=$NORMALIZED" >> "$GITHUB_OUTPUT"
- name: Run F5 Contributor License Agreement (CLA) assistant
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have hereby read the F5 CLA and agree to its terms') || github.event_name == 'pull_request_target'
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'))
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
with:
# Path to the CLA document.
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased

## Changed

- Enhanced CLA workflow to handle trailing punctuation in user comments. The workflow now automatically normalizes comments by trimming whitespace and removing trailing punctuation marks (`.`, `!`, `?`, `;`, `,`), allowing users to naturally add punctuation to their CLA agreement statement without causing approval failures.

# Feb 6, 2025

Initial release.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ If a previous signature from the authors of the PR is not found within this F5's

Upon detection of the specified phrase by the author in a PR comment, the action is retriggered and the authors information is collected and committed to F5's data storage.

**Note:** The workflow automatically normalizes comments by trimming whitespace and removing trailing punctuation (`.`, `!`, `?`, `;`, `,`), so users can naturally add punctuation to the end of their CLA agreement statement without causing the approval to fail.

### Status Check Integrations

This action integrates directly with GitHub's Status Check feature. If the action determines that signatures are still required from the pull request's author(s), it will show a failing status and vice-versa.
Expand Down