-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (84 loc) · 2.44 KB
/
pull-request-default.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: 'Pull Request: Default'
on:
pull_request:
branches:
- 'main'
env:
NODE_ENV: 'test'
jobs:
check_for_bot:
name: "Check for bot"
runs-on: ubuntu-latest
outputs:
is_bot: ${{ steps.bot.outputs.is_bot }}
steps:
- name: "[Check] Bot"
id: bot
run: |
if [[ ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} == bot-* ]]; then
echo "Bot detected. Skipping...";
echo "is_bot=true" >> $GITHUB_OUTPUT;
else
echo "Not a bot. Proceeding to other jobs.";
echo "is_bot=false" >> $GITHUB_OUTPUT;
fi
eslint:
name: 'ESlint'
needs: check_for_bot
if: needs.check_for_bot.outputs.is_bot == 'false'
uses: ./.github/workflows/re-eslint.yml
prettier:
name: 'Prettier'
needs: check_for_bot
if: needs.check_for_bot.outputs.is_bot == 'false'
uses: ./.github/workflows/re-prettier.yml
typescript:
name: 'Typescript'
needs: check_for_bot
if: needs.check_for_bot.outputs.is_bot == 'false'
uses: ./.github/workflows/re-typescript.yml
tests:
name: 'Tests'
needs: check_for_bot
if: needs.check_for_bot.outputs.is_bot == 'false'
uses: ./.github/workflows/re-tests.yml
branch_name:
name: Branch Name
needs: check_for_bot
if: needs.check_for_bot.outputs.is_bot == 'false'
runs-on: ubuntu-latest
steps:
- name: '[Setup] Checkout'
uses: actions/checkout@v4
- name: '[Setup] Node.js'
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
check-latest: false
cache: npm
cache-dependency-path: package-lock.json
- name: '[Setup] Install dependencies'
run: npm install
- name: '[Run] Branch Name'
run: sh ./.husky/branch-name
pr_name:
name: PR Name
needs: check_for_bot
if: needs.check_for_bot.outputs.is_bot == 'false'
runs-on: ubuntu-latest
steps:
- name: '[Setup] Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: '[Setup] Node.js'
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
check-latest: false
cache: npm
cache-dependency-path: package-lock.json
- name: '[Setup] Install dependencies'
run: npm install
- name: '[Run] PR Name'
run: echo "${{ github.event.pull_request.title }}" | npx --no -- commitlint