-
Notifications
You must be signed in to change notification settings - Fork 324
40 lines (36 loc) · 1.59 KB
/
ci-pr-title-validation.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
name: PR Title Validation
on:
pull_request:
types: [opened, synchronize, reopened, edited]
# Copied & adapted (job name, version label) from
# https://github.com/ytanikin/pr-conventional-commits?tab=readme-ov-file#usage-with-labeling-where-label-is-just-a-task-type
jobs:
validate-pr-title:
name: PR Conventional Commit Validation
runs-on: ubuntu-latest
steps:
- name: Validate PR Title
uses: ytanikin/pr-conventional-commits@8d258b54939f6769fcd935a52b96d6b0383a00c5 # v1.2.0
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
pr-title-check:
name: Check PR Title for Deprecated Flags
runs-on: ubuntu-latest
steps:
- name: Check PR Title
id: check-pr-title
env:
CI_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ $CI_PULL_REQUEST_TITLE == *"[S3_UPLOAD]"* ]]; then
echo "Error: The [S3_UPLOAD] flag has been deprecated. Please use [RUN_ALL_BAZEL_TARGETS] instead. It will automatically upload to S3."
exit 1
fi
if [[ $CI_PULL_REQUEST_TITLE == *"[override-didc-check]"* ]]; then
echo "Error: The [override-didc-check] flag in the PR TITLE has been deprecated. Please use the PR label instead."
exit 1
fi
if [[ $CI_PULL_REQUEST_TITLE == *"[RUN_ALL_BAZEL_TARGETS]"* ]]; then
echo "Error: The [RUN_ALL_BAZEL_TARGETS] flag in the PR TITLE has been deprecated. Please use the PR label instead. See .github/CI_README.md."
exit 1
fi