From 6772acb4ac9fa4421b50068af58806a365a202cd Mon Sep 17 00:00:00 2001 From: Julien Maupetit Date: Tue, 26 Mar 2024 17:42:34 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7(project)=20add=20git=20history=20a?= =?UTF-8?q?nd=20changelog=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For now, we do not enforce our git commits format, but we will 😉 --- .github/workflows/chore.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/chore.yml diff --git a/.github/workflows/chore.yml b/.github/workflows/chore.yml new file mode 100644 index 00000000..7a7b6d8e --- /dev/null +++ b/.github/workflows/chore.yml @@ -0,0 +1,39 @@ +name: Chore checks + +on: + push: + branches-ignore: ["main"] + pull_request: + branches-ignore: ["main"] + +jobs: + fixup-commits: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check absence of fixup commits + run: | + ! git log --pretty=format:%s | grep 'fixup!' + + check-changelog: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check that the CHANGELOG has been modified in the current branch + run: | + git diff --name-only origin/main | grep CHANGELOG + + lint-changelog: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Check CHANGELOG max line length + run: | + test $(cat CHANGELOG.md | grep -Ev "^\[.*\]: https://github.com/MTES-MCT/qualicharge" | wc -L) -le 80