diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bdf535eb9..f3d9d9514 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,8 @@ ## Summary +Signed-off-by: Your Name + ## Related Issue diff --git a/.github/workflows/dco-check.yaml b/.github/workflows/dco-check.yaml new file mode 100644 index 000000000..a9981ce91 --- /dev/null +++ b/.github/workflows/dco-check.yaml @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +name: dco-check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + dco-check: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Check PR body for Signed-off-by + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + normalized_body="$(printf '%s\n' "$PR_BODY" | tr -d '\r')" + + if ! printf '%s\n' "$normalized_body" | grep -qP '^Signed-off-by:\s+.+\s+<[^<>]+>$'; then + echo "::error::PR description must contain a DCO sign-off line." + echo "::error::Expected format: Signed-off-by: Your Name " + exit 1 + fi + + echo "PR description contains a DCO sign-off."