Skip to content

Commit 68f5aae

Browse files
committed
[skip ci] chore: update ci
1 parent 0055aea commit 68f5aae

File tree

2 files changed

+12
-50
lines changed

2 files changed

+12
-50
lines changed

.github/workflows/auto-version-release.yml

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@ on:
44
pull_request:
55
types: [closed]
66
branches: [main]
7-
push:
8-
branches: [main]
9-
paths-ignore:
10-
- 'package.json'
11-
- 'package-lock.json'
12-
- 'CHANGELOG.md'
137

148
jobs:
159
version-and-release:
16-
# Only run on merged PRs or direct pushes (not on close without merge)
17-
if: |
18-
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19-
(github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]'))
10+
# Only run on merged PRs to main (not on close without merge or direct pushes to feature branches)
11+
if: github.event.pull_request.merged == true
2012

2113
runs-on: ubuntu-latest
2214
permissions:
@@ -65,43 +57,15 @@ jobs:
6557
exit 0
6658
fi
6759
68-
# For PRs, get the source branch name
69-
if [ "${{ github.event_name }}" == "pull_request" ]; then
70-
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
71-
echo "Source branch: $BRANCH_NAME"
72-
73-
# Check if this is a Dependabot PR
74-
if [ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ] || echo "$BRANCH_NAME" | grep -qE '^dependabot/'; then
75-
echo "🤖 Dependabot PR detected - no version bump"
76-
echo "skip=true" >> $GITHUB_OUTPUT
77-
exit 0
78-
fi
79-
else
80-
# For direct pushes, check commit message for branch info
81-
BRANCH_NAME=$(git log -1 --pretty=%B | grep -oP '(?<=from )[^\s]+' || echo "")
82-
if [ -z "$BRANCH_NAME" ]; then
83-
echo "No branch info in commit, checking for version tags in message"
84-
COMMIT_MSG=$(git log -1 --pretty=%B)
85-
86-
# Check for Dependabot commits
87-
if echo "$COMMIT_MSG" | grep -qE 'Bump .* from .* to .*|^\[dependabot\]|^chore\(deps'; then
88-
echo "🤖 Dependabot commit detected - no version bump"
89-
echo "skip=true" >> $GITHUB_OUTPUT
90-
exit 0
91-
fi
92-
93-
if echo "$COMMIT_MSG" | grep -qiE '\[major\]|breaking'; then
94-
BRANCH_NAME="major/direct"
95-
elif echo "$COMMIT_MSG" | grep -qiE '\[minor\]|feat'; then
96-
BRANCH_NAME="feature/direct"
97-
elif echo "$COMMIT_MSG" | grep -qiE '\[patch\]|fix'; then
98-
BRANCH_NAME="fix/direct"
99-
else
100-
echo "No version bump needed"
101-
echo "skip=true" >> $GITHUB_OUTPUT
102-
exit 0
103-
fi
104-
fi
60+
# Get the source branch name from the PR
61+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
62+
echo "Source branch: $BRANCH_NAME"
63+
64+
# Check if this is a Dependabot PR
65+
if [ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ] || echo "$BRANCH_NAME" | grep -qE '^dependabot/'; then
66+
echo "🤖 Dependabot PR detected - no version bump"
67+
echo "skip=true" >> $GITHUB_OUTPUT
68+
exit 0
10569
fi
10670
10771
# Determine version bump type based on branch prefix

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
"type-check": "tsc --noEmit",
3737
"typecheck": "tsc --noEmit",
3838
"prepublishOnly": "npm run clean && npm run lint && npm test && npm run build",
39-
"prepare": "npm run build",
40-
"version": "npm run build && git add -A dist",
41-
"postversion": "git push && git push --tags"
39+
"prepare": "npm run build"
4240
},
4341
"keywords": [
4442
"payload",

0 commit comments

Comments
 (0)