-
Notifications
You must be signed in to change notification settings - Fork 22
66 lines (58 loc) · 2.29 KB
/
main_pr.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Main-CI-PR-Flow
on:
pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited
# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
commitlint:
runs-on: starkware-ubuntu-latest-small
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install commitlint
run: npm install --global @commitlint/cli @commitlint/config-conventional
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request' && !(contains(github.event.pull_request.title, 'merge-main') || contains(github.event.pull_request.title, 'merge main'))
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose
- name: Validate PR title with commitlint
if: github.event_name != 'merge_group' && github.event_name != 'push' && !(contains(github.event.pull_request.title, 'merge-main') || contains(github.event.pull_request.title, 'merge main'))
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo "$TITLE" | commitlint --verbose
merge-gatekeeper:
runs-on: starkware-ubuntu-latest-small
# Restrict permissions of the GITHUB_TOKEN.
# Docs: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
checks: read
statuses: read
steps:
- name: Run Merge Gatekeeper on pull request
if: github.event_name == 'pull_request'
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
timeout: 1500
interval: 30
ignored: "code-review/reviewable"
- name: Run Merge Gatekeeper on Merge Queue || push
if: github.event_name == 'merge_group' || github.event_name == 'push'
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{github.ref}}
timeout: 1500
interval: 30
ignored: "code-review/reviewable"