From 0ebe33df428997a9213e8032e4589887cf823127 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 12 Nov 2023 20:57:31 +0100 Subject: [PATCH] Add action for checks --- .github/workflows/check.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..60c6551 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,29 @@ +name: Checks + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 + + gitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} # otherwise it thinkgs merging is a good idea + fetch-depth: 0 # required so gitlint can compare a range + - uses: actions/setup-python@v3 + - name: Install gitlint + run: pip install gitlint==0.19.1 + - name: gitlint + if: github.event_name == 'pull_request' + run: | + gitlint --commits remotes/origin/$GITHUB_BASE_REF..remotes/origin/$GITHUB_HEAD_REF