forked from kumahq/kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 2.03 KB
/
check.yaml
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
name: "PR health"
on:
pull_request:
types:
- edited
- opened
- reopened
- synchronize
permissions:
contents: read
pull-requests: write
jobs:
commit-lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Check PR title
# This job checks the PR title using
# https://github.com/conventional-changelog/commitlint
# for the conventional commit format at
# https://www.conventionalcommits.org/en/v1.0.0/
# See also /.github/commitlint.config.js for more details
# We only need to check the PR title because it will end up being the
# (default) commit title when doing squash merges with Github.
# See
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#merge-message-for-a-squash-merge
# for more info. We have "Default to PR title for squash merge commits" enabled.
if: github.event.action != 'synchronize'
# Inject as env variable to escape properly
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
npm install -g @commitlint/cli@19.0.1 @commitlint/config-conventional@19.0.0
commitlint --config .github/commitlint.config.js --edit=<(echo "${TITLE}")
- name: Maybe add backport label
if: github.event.action == 'synchronize' && false # disable until https://github.com/kumahq/kuma/issues/9482
env:
GITHUB_TOKEN: ${{ github.token }}
PREDEFINED_GLOBS: ".github/**/*,.circleci/**/*,Makefile,mk/**/*,tools/**/*,.golangci.yml,.kube-linter.yaml"
LABEL_TO_ADD: backport
NO_BACKPORT_AUTOLABEL: no-backport-autolabel
run: |
tools/ci/needs_backporting.sh "${{ github.repository }}" "${{ github.event.pull_request.number }}" "origin/${{ github.base_ref }}" "HEAD" "$PREDEFINED_GLOBS" "$LABEL_TO_ADD" "$NO_BACKPORT_AUTOLABEL"