๐Ÿ“ฆ payloadcms / payload

๐Ÿ“„ pr-title.yml ยท 131 lines
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131name: pr-title

on:
  pull_request_target:
    types:
      - opened
      - edited

permissions:
  pull-requests: write

jobs:
  main:
    name: lint-pr-title
    runs-on: ubuntu-24.04
    steps:
      - uses: amannn/action-semantic-pull-request@v6
        id: lint_pr_title
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          types: |
            build
            chore
            ci
            docs
            examples
            feat
            fix
            perf
            refactor
            revert
            style
            templates
            test
          scopes: |
            cpa
            claude
            db-\*
            db-d1-sqlite
            db-mongodb
            db-postgres
            db-vercel-postgres
            db-sqlite
            db-d1-sqlite
            drizzle
            email-\*
            email-nodemailer
            email-resend
            eslint
            graphql
            kv
            kv-redis
            live-preview
            live-preview-react
            next
            payload-cloud
            plugin-cloud
            plugin-cloud-storage
            plugin-ecommerce
            plugin-form-builder
            plugin-import-export
            plugin-mcp
            plugin-multi-tenant
            plugin-nested-docs
            plugin-redirects
            plugin-search
            plugin-sentry
            plugin-seo
            plugin-stripe
            richtext-\*
            richtext-lexical
            richtext-slate
            sdk
            storage-\*
            storage-azure
            storage-gcs
            storage-r2
            storage-uploadthing
            storage-vercel-blob
            storage-s3
            translations
            ui
            templates
            examples(\/(\w|-)+)?
            deps

          # Disallow uppercase letters at the beginning of the subject
          subjectPattern: ^(?![A-Z]).+$
          subjectPatternError: |
            The subject "{subject}" found in the pull request title "{title}"
            didn't match the configured pattern. Please ensure that the subject
            doesn't start with an uppercase character.

      - uses: marocchino/sticky-pull-request-comment@v2
        # When the previous steps fails, the workflow would stop. By adding this
        # condition you can continue the execution with the populated error message.
        if: always() && (steps.lint_pr_title.outputs.error_message != null)
        with:
          header: pr-title-lint-error
          message: |
            Pull Request titles must follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and have valid scopes.

            ${{ steps.lint_pr_title.outputs.error_message }}

            ```
            feat(ui): add Button component
            ^    ^    ^
            |    |    |__ Subject
            |    |_______ Scope
            |____________ Type
            ```

      # Delete a previous comment when the issue has been resolved
      - if: ${{ steps.lint_pr_title.outputs.error_message == null }}
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: pr-title-lint-error
          delete: true

  label-pr-on-open:
    name: label-pr-on-open
    runs-on: ubuntu-24.04
    if: github.event.action == 'opened'
    steps:
      - name: Tag with 2.x branch with v2
        if: github.event.pull_request.base.ref == '2.x'
        uses: actions-ecosystem/action-add-labels@v1
        with:
          labels: v2