Skip to content

refactor: remove all as type assertions from source code #802

refactor: remove all as type assertions from source code

refactor: remove all as type assertions from source code #802

Workflow file for this run

name: DCO
on:
pull_request:
types: [opened, edited, synchronize, reopened]
branches:
- main
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
dco:
name: DCO Sign-off Check
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- name: Check DCO sign-off
run: |
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
failed=0
for sha in $(git rev-list --no-merges "$base".."$head"); do
if ! git log -1 --format='%B' "$sha" | grep -qiE '^Signed-off-by: .+ <.+>'; then
echo "::error::Commit $sha is missing a DCO Signed-off-by line."
echo " $(git log -1 --format='%s' "$sha")"
failed=1
fi
done
if [ "$failed" -eq 1 ]; then
echo ""
echo "All commits must include a Signed-off-by line."
echo "Use 'git commit -s' to sign, or 'git rebase --signoff HEAD~N' to fix existing commits."
echo "See: https://developercertificate.org/"
exit 1
fi
echo "All commits are signed off."