generated from ViBiOh/goweb
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1015 Bytes
/
branch_clean.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
name: Git
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
on:
- pull_request
jobs:
build:
name: Branch is clean
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Fetch branches
run: |
git fetch --no-tags --prune origin "+refs/heads/${BASE}:refs/remotes/origin/${BASE}"
env:
BASE: ${{ github.base_ref }}
- name: Check commits
env:
BASE: origin/${{ github.base_ref }}
HEAD: HEAD
run: |
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap" | bash -s -- "-c" "git_branch_clean"
scripts/git_branch_clean "${BASE}" "${HEAD}"