Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ jobs:

- name: Check PR description is signed off
if: github.event_name == 'pull_request'
env:
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
)

echo "::error ::Pull request has not been signed off in the PR description with a \`Signed-off-by:\` line"
exit 1
fi
Expand Down
Loading