Skip to content

Commit 87ae880

Browse files
committed
ci: integrate pr-title-lint into ci
1 parent 090c3cc commit 87ae880

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# CI: proto and commitlint; fan-out Go (fmt, lint, unit-tests) || UI (ui-lint, ui-test);
22
# then build (gitops, gitops-server). On tag: image, chart, goreleaser.
33
#
4-
# Flow: conventional-commits (if !tag) -> proto (make proto, git diff) in parallel with
5-
# ui-lint, ui-test. Then go-fmt, go-lint, go-unit-tests (need proto). Then build
4+
# Flow: pr-title-lint (if PR; else skipped) -> conventional-commits (if !tag;
5+
# runs when pr-title-lint success or skipped) -> proto (make proto, git diff)
6+
# in parallel with ui-lint, ui-test. Then go-fmt,
7+
# go-lint, go-unit-tests (need proto). Then build
68
# (make gitops, make gitops-server). Tag jobs (image, chart, goreleaser) need build.
79
# No make clean (each run is a fresh checkout).
810
#
@@ -31,10 +33,49 @@ env:
3133
PYTHON_VERSION: "3.12"
3234

3335
jobs:
36+
pr-title-lint:
37+
name: Validate PR title
38+
runs-on: ubuntu-latest
39+
if: github.event_name == 'pull_request'
40+
permissions:
41+
pull-requests: write
42+
steps:
43+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
44+
id: lint_pr_title
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
49+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
50+
with:
51+
header: pr-title-lint-error
52+
message: |
53+
Hey there and thank you for opening this pull request! :wave:
54+
55+
We require pull request titles to follow the
56+
[Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/)
57+
and it looks like your proposed title needs to be adjusted.
58+
59+
We use the pull request title in automated release changelog updates, and would like our
60+
changelogs to look nice.
61+
62+
Details:
63+
64+
```
65+
${{ steps.lint_pr_title.outputs.error_message }}
66+
```
67+
68+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
69+
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
70+
with:
71+
header: pr-title-lint-error
72+
delete: true
73+
3474
conventional-commits:
3575
name: Conventional Commits
76+
needs: [pr-title-lint]
3677
runs-on: ubuntu-latest
37-
if: "!startsWith(github.ref, 'refs/tags/')"
78+
if: always() && (needs.pr-title-lint.result == 'success' || needs.pr-title-lint.result == 'skipped') && !startsWith(github.ref, 'refs/tags/')
3879
steps:
3980
- uses: actions/checkout@v4
4081
with:

ui/components/__tests__/__snapshots__/Footer.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ exports[`Footer snapshots default 1`] = `
170170
class="c3"
171171
>
172172
©
173-
2025
173+
2026
174174
Weaveworks
175175
</span>
176176
</div>
@@ -347,7 +347,7 @@ exports[`Footer snapshots no api version 1`] = `
347347
class="c3"
348348
>
349349
©
350-
2025
350+
2026
351351
Weaveworks
352352
</span>
353353
</div>

0 commit comments

Comments
 (0)