-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.29 KB
/
develop-verify-merge.yaml
File metadata and controls
40 lines (33 loc) · 1.29 KB
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
## This Action verifieds that PRs against 'develop' branch can be merged
## - Do not allow branches with `poc/` or `wip/` to be merged
## - Ensure PR title matches the branch prefix
name: Develop-Verify Merge
on:
pull_request:
types: [opened, edited, synchronize, reopened]
branches:
- develop
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify-develop-merge:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v6.0.2
- name: Prevent POC/WIP branches
run: |
/bin/bash scripts/workflows/verify-merge.sh
exit $?
env:
BRANCH: ${{ github.event.pull_request.head.ref }}
- name: "Get Branch Prefix"
run: echo "##[set-output name=prefix;] $(echo $BRANCH_NAME | sed 's/\/.*//')"
id: extract_branch
env:
BRANCH_NAME: ${{ github.head_ref }}
- name: "Verify PR Title matches branch prefix (and conventional commit)"
uses: deepakputhraya/action-pr-title@master
with:
regex: '(\([\w\s]*\)*\))?:[\w\s]*'
allowed_prefixes: ${{ steps.extract_branch.outputs.prefix }},build # add build to not fail dependabot PRs
prefix_case_sensitive: true