From 143bfe9b01cd6df3b38d8e9006ef040302b6a7fc Mon Sep 17 00:00:00 2001 From: "Quentin, Derory" <15911421+quentinDERORY@users.noreply.github.com> Date: Wed, 12 May 2021 10:21:07 -0700 Subject: [PATCH] [ci][dco] Automatically comment PR when failing DCO check Signed-off-by: Quentin, Derory <15911421+quentinDERORY@users.noreply.github.com> --- .github/workflows/dco-check.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/dco-check.yml b/.github/workflows/dco-check.yml index b2bb528c7abb..df34a41858b4 100644 --- a/.github/workflows/dco-check.yml +++ b/.github/workflows/dco-check.yml @@ -20,3 +20,21 @@ jobs: uses: tim-actions/dco@master with: commits: ${{ steps.get-pr-commits.outputs.commits }} + - name: DCO comment + if: failure() + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + var msg = `Oops, Seems like you failed the \`DCO check\`. Make sure to sign all your commits. + + ### Howto + + - ***Managing commit signature verification.*** [\`Official github documentation\`](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification)` + + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: msg, + })