mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-18 10:42:14 -05:00
5d6e3fcecc
Some checks failed
Publish Images / Build and Test (push) Has been cancelled
Build and Test / Set build metadata (push) Has been cancelled
Build and Test / Build test suite matrix (push) Has been cancelled
Build and Test / preview-release-notes (push) Has been cancelled
Lint commit / commitlint (push) Has been cancelled
Publish Images / Release (push) Has been cancelled
Build and Test / Build and Test (push) Has been cancelled
Build and Test / Test the Super-linter GitHub Action (push) Has been cancelled
Build and Test / Run test cases (push) Has been cancelled
Build and Test / Check if all the tests passed (push) Has been cancelled
Add support to run Commitlint against commit messages. It supports the current modes: - Lint the commit message of the last commit - Lint the commit messages of the pushed commits in case there is more than one pushed commit This commit also removes stuff that we used to run commitlint as a standalone tool because we can now use the commitlint instance that Super-linter ships: - lint-commit steps in lint-commit the GitHub Actions workflow - lint-commit Make target - commitlint and its dependencies in package.json and package-lock.json
37 lines
893 B
YAML
37 lines
893 B
YAML
---
|
|
name: Lint commit
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
merge_group:
|
|
|
|
# Don't grant any access by default
|
|
permissions: {}
|
|
|
|
jobs:
|
|
commitlint:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check if the pull request contains a single commit
|
|
if: github.event_name == 'pull_request'
|
|
run: |
|
|
commit_count=${{ github.event.pull_request.commits }}
|
|
|
|
if [ -z ${commit_count} ]; then
|
|
echo "[ERROR] commit_count is empty"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ${commit_count} -ne 1 ]]; then
|
|
echo "[ERROR] This pull request contains ${commit_count} commits. Squash these commits into a single commit."
|
|
exit 1
|
|
else
|
|
echo "This pull request contains ${commit_count} commit."
|
|
fi
|