Skip to content

[IMPROVED] CI: Check PR sign-offs with env variable#7033

Merged
neilalexander merged 1 commit intomainfrom
maurice/gh-pr-tests
Jul 3, 2025
Merged

[IMPROVED] CI: Check PR sign-offs with env variable#7033
neilalexander merged 1 commit intomainfrom
maurice/gh-pr-tests

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

Capture github.event.pull_request.body in "$PR_DESC" as the PR description.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner July 3, 2025 11:11
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit 45d2da1 into main Jul 3, 2025
48 checks passed
@neilalexander neilalexander deleted the maurice/gh-pr-tests branch July 3, 2025 11:23
PR_DESC: ${{ github.event.pull_request.body }}
run: |
if ! echo "${{ github.event.pull_request.body }}" | grep -Pq '^Signed-off-by:\s*(?!Your Name|.*<your\.email@example\.com>)'; then
if ! echo "$PR_DESC" | grep -Pq '^Signed-off-by:\s*(?!Your Name|.*<your\.email@example\.com>)'; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you use something like this instead:

[[ ${{ github.event.pull_request.body }} =~ ^Signed-off-by:\s*(?!Your Name|.*<your\.email@example\.com>) ]] || (
  echo "::error ::Pull request has not been signed off in the PR description with a \`Signed-off-by:\` line"
  exit 1
)

@wallyqs wallyqs changed the title CI: Check PR sign-offs with env variable [CI] Check PR sign-offs with env variable Jul 24, 2025
@wallyqs wallyqs changed the title [CI] Check PR sign-offs with env variable CI: Check PR sign-offs with env variable Jul 24, 2025
@wallyqs wallyqs changed the title CI: Check PR sign-offs with env variable [CHANGED] CI: Check PR sign-offs with env variable Jul 24, 2025
@wallyqs wallyqs changed the title [CHANGED] CI: Check PR sign-offs with env variable [IMPROVED] CI: Check PR sign-offs with env variable Jul 24, 2025
neilalexander added a commit that referenced this pull request Jul 25, 2025
Includes the following:

- #7031
- #7033
- #7034
- #7035
- #7036
- #7040
- #7043
- #7045
- #7047
- #7046
- #7050
- #7051
- #7052
- #7053
- #7061
- #7063
- #7064
- #7065
- #7066
- #7070
- #7072
- #7080
- #7026
- #6728
- #7074
- #7089
- #7095
- #7087
- #7094
- #7096
- #7099

Signed-off-by: Neil Twigg <neil@nats.io>
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.

3 participants