-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (54 loc) · 2.07 KB
/
Copy pathpull-requests.yaml
File metadata and controls
76 lines (54 loc) · 2.07 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
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
67
68
69
70
71
72
73
74
75
76
---
name: Pull Requests
on:
workflow_call:
jobs:
conventional-pr-title:
name: Conventional PR Title
runs-on: ubuntu-latest
steps:
- name: Conventional Commit PR Title
uses: agenthunt/conventional-commit-checker-action@v1.0.0
with:
pr-title-regex: "^(.+)(?:(([^)s]+)))?: (.+)"
pr-body-regex: "(.*)"
conventional-commits:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- name: Check Commits
uses: taskmedia/action-conventional-commits@v1.1.17
with:
token: ${{ github.token }}
skip_merge: true
skip_revert: true
types: "build|bump|chore|ci|docs|feat|fix|perf|refactor|revert|style|test"
pr_dependencies:
runs-on: ubuntu-latest
name: Dependency Check
steps:
- uses: gregsdennis/dependencies-action@ae6e0529ef70f1366a21972f40b1ad0e1b5e3218 # v1.4.1
# with:
# custom-domains: my-custom-domain.io another.domain.com
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pr_contains_current_head:
runs-on: ubuntu-latest
name: Ensure PR does not require rebase
if: github.event.pull_request.head.ref != 'master' && github.event.pull_request.head.ref != 'development'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify PR contains latest base branch
shell: bash
run: |
git fetch origin "${{ github.event.pull_request.base.ref }}" --no-tags
echo "Source: ${{ github.event.pull_request.head.ref }} [${{ github.event.pull_request.head.sha }}]";
echo "Destination: ${{ github.event.pull_request.base.ref }} [${{ github.event.pull_request.base.sha }}]"
if ! git merge-base --is-ancestor \
"${{ github.event.pull_request.base.sha }}" \
"refs/remotes/pull/${{ github.event.pull_request.number }}/merge"; then
echo "::error::PR branch does not contain the latest HEAD of the source branch ${{ github.event.pull_request.base.sha }}."
exit 1
fi