From 556ad3a67a18113cd74116b2896e05ad7a9e16fb Mon Sep 17 00:00:00 2001 From: Piotr Czeglik Date: Mon, 24 Jun 2024 23:30:51 +0200 Subject: [PATCH 1/2] ci: block fixup commits --- .github/workflows/git-checks.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/git-checks.yml diff --git a/.github/workflows/git-checks.yml b/.github/workflows/git-checks.yml new file mode 100644 index 0000000..1131680 --- /dev/null +++ b/.github/workflows/git-checks.yml @@ -0,0 +1,15 @@ +name: Git Checks + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + block-fixup: + if: github.event.pull_request.draft == false + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + - name: Block Fixup Commit Merge + uses: 13rac1/block-fixup-merge-action@v2.0.0 From 8c0f73238c470b0417ed9f82d82c094557e0cefd Mon Sep 17 00:00:00 2001 From: Piotr Czeglik Date: Mon, 24 Jun 2024 23:34:27 +0200 Subject: [PATCH 2/2] ci: lint commit message --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c71e441..cfbc07c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Collect Workflow Telemetry uses: catchpoint/workflow-telemetry-action@v2 @@ -41,6 +43,9 @@ jobs: - name: Install dependencies run: yarn install --immutable --inline-builds + - name: Validate PR commits with commitlint + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + - name: Format run: yarn format-check