-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (28 loc) · 1.11 KB
/
pull_request.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
name: Validate Pull Request
on:
pull_request:
types: [opened, synchronize, reopened, edited]
env:
LOCAL_PR: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
TEST_TRIGGER: ${{ github.event.action == 'synchronize' || github.event.action == 'opened' || github.event.action == 'reopened'}}
jobs:
isort:
# if PR is external, trigger the tests on push or new PR
if: ${{ !env.LOCAL_PR && env.TEST_TRIGGER }}
uses: ./.github/workflows/isort.yml
black:
if: ${{ !env.LOCAL_PR && env.TEST_TRIGGER }}
uses: ./.github/workflows/black.yml
build:
if: ${{ !env.LOCAL_PR && env.TEST_TRIGGER }}
uses: ./.github/workflows/build.yml
validate-pr-title:
# Trigger only for local PR when PR is edited (title, description, etc.)
if: ${{ env.LOCAL_PR && github.event.action == 'edited' }}
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/[email protected]
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","revert"]'
token: ${{ steps.app-token.outputs.token }}