From 119e54b99851316db06cdf31d19655aca5588562 Mon Sep 17 00:00:00 2001 From: Aylong <69762909+AyIong@users.noreply.github.com> Date: Fri, 20 Sep 2024 06:56:01 +0300 Subject: [PATCH] Create prevent_squash.yml (#8) * Create prevent_squash.yml * Update prevent_squash.yml --- .github/workflows/prevent_squash.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/prevent_squash.yml diff --git a/.github/workflows/prevent_squash.yml b/.github/workflows/prevent_squash.yml new file mode 100644 index 000000000000..2df289a21457 --- /dev/null +++ b/.github/workflows/prevent_squash.yml @@ -0,0 +1,22 @@ +name: "Prevent Squash Merge" + +on: + pull_request_target: + types: [opened, reopened, edited, labeled, ready_for_review, draft] + +jobs: + prevent-squash: + runs-on: ubuntu-latest + + steps: + - name: Check label + uses: actions/github-script@v6 + with: + script: | + const forbiddenLabel = "Merge Upstream"; // Замените на ваш лейбл + const { mergeable, labels } = context.payload.pull_request; + const hasForbiddenLabel = labels.some(label => label.name === forbiddenLabel); + + if (hasForbiddenLabel && mergeable) { + throw new Error(`Ты долбоёб блять! Не сквош мерж апстрима!!!`); + }