Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # SPDX-FileCopyrightText: Andrei Gherzan <andrei.gherzan@huawei.com> |
| 4 | # |
| 5 | # SPDX-License-Identifier: MIT |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | # shellcheck disable=SC1091 |
| 10 | . /utils.sh |
| 11 | |
| 12 | GIT_REPO_PATH="/work" |
| 13 | |
| 14 | [ -n "$BASE_REF" ] || |
| 15 | error "DCO checks needs to know the target branch. Make sure that is set in BASE_REF." |
| 16 | [ -d "$GIT_REPO_PATH/.git" ] || |
| 17 | error "Can't find a git checkout under $GIT_REPO_PATH ." |
| 18 | cd "$GIT_REPO_PATH" |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 19 | |
| 20 | # The GitHub runner user and the container user might differ making git error |
| 21 | # out with: |
| 22 | # error: fatal: detected dubious ownership in repository at '/work' |
| 23 | # Avoid this as the security risk is minimum here while guarding the git hooks |
| 24 | # via PRs. |
| 25 | git config --global --add safe.directory /work |
| 26 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 27 | dco-check \ |
| 28 | --verbose \ |
| 29 | --default-branch "origin/$BASE_REF" |