Skip to content

Commit d9ae856

Browse files
committed
ci: add auto PR creation workflow and fix release condition
1 parent 828cb44 commit d9ae856

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed

.github/workflows/create-pr.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Create PR
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
jobs:
9+
create-pr:
10+
runs-on: ubuntu-latest
11+
if: |
12+
startsWith(github.event.head_commit.message, 'feat') ||
13+
startsWith(github.event.head_commit.message, 'fix') ||
14+
startsWith(github.event.head_commit.message, 'docs') ||
15+
startsWith(github.event.head_commit.message, 'refactor') ||
16+
startsWith(github.event.head_commit.message, 'perf') ||
17+
startsWith(github.event.head_commit.message, 'test') ||
18+
startsWith(github.event.head_commit.message, 'chore')
19+
permissions:
20+
contents: read
21+
pull-requests: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Create Pull Request
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
gh pr create \
30+
--base main \
31+
--head release \
32+
--title "${{ github.event.head_commit.message }}" \
33+
--body "Auto-generated PR from release branch"

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- 'README.md'
9-
- 'docs/**'
10-
- '*.md'
8+
- "README.md"
9+
- "docs/**"
10+
- "*.md"
1111

1212
permissions:
1313
contents: write
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
release:
1919
runs-on: ubuntu-latest
20-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
20+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
2121

2222
steps:
2323
- name: Checkout
@@ -29,8 +29,8 @@ jobs:
2929
- name: Setup Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: '22'
33-
cache: 'npm'
32+
node-version: "22"
33+
cache: "npm"
3434

3535
- name: Install dependencies
3636
run: npm ci
@@ -45,4 +45,4 @@ jobs:
4545
env:
4646
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747
VSCE_PAT: ${{ secrets.VSCE_PAT }}
48-
run: npx semantic-release
48+
run: npx semantic-release

0 commit comments

Comments
 (0)