Skip to content

Commit 30db151

Browse files
authored
Merge pull request #1 from CodingWithCalvin/fix/deploy-workflow-paths
fix(ci): update deploy workflow paths and step name
2 parents ddb034a + 5790b78 commit 30db151

3 files changed

Lines changed: 108 additions & 29 deletions

File tree

.commitlintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Commitlint configuration for conventional commits
2+
# Based on: https://www.conventionalcommits.org/
3+
4+
extends:
5+
- '@commitlint/config-conventional'
6+
7+
rules:
8+
# Type enum - allowed commit types
9+
type-enum:
10+
- 2 # Level: error
11+
- always
12+
- # Allowed types:
13+
- feat # New feature
14+
- fix # Bug fix
15+
- docs # Documentation only changes
16+
- style # Code style changes (formatting, missing semi-colons, etc)
17+
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
18+
- perf # Performance improvements
19+
- test # Adding or updating tests
20+
- build # Changes to build system or dependencies
21+
- ci # CI/CD configuration changes
22+
- chore # Other changes that don't modify src or test files
23+
- revert # Revert a previous commit
24+
25+
# Type case should be lowercase
26+
type-case:
27+
- 2
28+
- always
29+
- lower-case
30+
31+
# Type must not be empty
32+
type-empty:
33+
- 2
34+
- never
35+
36+
# Scope case should be lowercase
37+
scope-case:
38+
- 2
39+
- always
40+
- lower-case
41+
42+
# Subject must not be empty
43+
subject-empty:
44+
- 2
45+
- never
46+
47+
# Subject must not end with a period
48+
subject-full-stop:
49+
- 2
50+
- never
51+
- '.'
52+
53+
# Disable subject-case to allow uppercase abbreviations (PR, API, CLI, etc.)
54+
subject-case:
55+
- 0
56+
57+
# Header (first line) max length
58+
header-max-length:
59+
- 2
60+
- always
61+
- 72
62+
63+
# Body should have a blank line before it
64+
body-leading-blank:
65+
- 1 # Warning level
66+
- always
67+
68+
# Footer should have a blank line before it
69+
footer-leading-blank:
70+
- 1 # Warning level
71+
- always
72+
73+
# Body max line length
74+
body-max-line-length:
75+
- 1 # Warning level
76+
- always
77+
- 100
78+
79+
# Help URL shown in error messages
80+
helpUrl: 'https://www.conventionalcommits.org/'

.github/workflows/commit-lint.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
1-
name: Commit Lint
1+
name: Lint Commit Messages
22

33
on:
44
pull_request:
5-
types:
6-
- opened
7-
- edited
8-
- synchronize
5+
types: [opened, edited, reopened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
910

1011
jobs:
11-
lint:
12+
lint-pr-title:
13+
name: Lint PR Title
1214
runs-on: ubuntu-latest
1315
steps:
14-
- name: Check PR title format
15-
uses: amannn/action-semantic-pull-request@v5
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
1821
with:
19-
types: |
20-
feat
21-
fix
22-
docs
23-
style
24-
refactor
25-
perf
26-
test
27-
build
28-
ci
29-
chore
30-
revert
31-
requireScope: false
32-
subjectPattern: ^[a-z].+$
33-
subjectPatternError: |
34-
The subject "{subject}" found in the pull request title "{title}"
35-
didn't match the configured pattern. Please ensure that the subject
36-
starts with a lowercase letter.
22+
node-version: '20'
23+
24+
- name: Install commitlint
25+
run: |
26+
npm install --save-dev @commitlint/cli@18.4.3 @commitlint/config-conventional@18.4.3
27+
28+
- name: Validate PR title
29+
env:
30+
PR_TITLE: ${{ github.event.pull_request.title }}
31+
run: |
32+
echo "Validating PR title: $PR_TITLE"
33+
echo "$PR_TITLE" | npx commitlint --verbose

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
- 'package.json'
1212
- 'package-lock.json'
1313
- 'tsconfig.json'
14+
- 'wrangler.toml'
15+
- '.github/workflows/deploy.yml'
1416
workflow_dispatch:
1517

1618
jobs:
@@ -35,7 +37,7 @@ jobs:
3537
- name: Build
3638
run: npm run build
3739

38-
- name: Deploy to Cloudflare Pages
40+
- name: Deploy to Cloudflare Workers
3941
uses: cloudflare/wrangler-action@v3
4042
with:
4143
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}

0 commit comments

Comments
 (0)