From 48947f841d5c3d4148cbf3f3b0b00af957f8f396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Thu, 19 May 2022 17:41:44 +0000 Subject: [PATCH] ci: kontrolovat pull requesty --- .github/workflows/pr.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..31cfa27 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,33 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: amannn/action-semantic-pull-request@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: wagoid/commitlint-github-action@v4 + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + branch: + name: Uzavřít PRy mimo dev větev + needs: main + if: github.base_ref != 'dev' && github.actor != 'hernikplays' + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: "Všechny pull requesty by měly směřovat na `dev` větev. Pokud je tohle chyba, napište správci repozitáře."