| # Copyright lowRISC contributors. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| # A wrapper around lint_commits.py, used for CI. |
| # Expects a single argument, which is the pull request's target branch |
| echo >&2 "Usage: lint-commits.sh <tgt-branch>" |
| merge_base="$(git merge-base origin/$tgt_branch HEAD)" || { |
| echo >&2 "Failed to find fork point for origin/$tgt_branch." |
| echo "Checking commit messages since $merge_base" |
| # * Merge commits are not checked. We always use rebases instead of |
| # merges to keep a linear history, which makes merge commits disappear |
| # ultimately, making them only a CI artifact which should not be |
| # * 'type=error' is used even for warnings. Only "errors" are shown in |
| # the GitHub checks API. However, warnings don't return a non-zero |
| # error code so don't fail the build step. |
| --error-msg-prefix="##vso[task.logissue type=error]" \ |
| --warning-msg-prefix="##vso[task.logissue type=error]" \ |