Skip to content

Commit

Permalink
Create prevent_squash.yml (#8)
Browse files Browse the repository at this point in the history
* Create prevent_squash.yml

* Update prevent_squash.yml
  • Loading branch information
AyIong authored Sep 20, 2024
1 parent a6d04d9 commit 119e54b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/prevent_squash.yml
Original file line number Diff line number Diff line change
@@ -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(`Ты долбоёб блять! Не сквош мерж апстрима!!!`);
}

0 comments on commit 119e54b

Please sign in to comment.