Skip to content

Commit 6d11b93

Browse files
committed
chore: auto set major as 'latest'
1 parent 055f9d7 commit 6d11b93

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/aliases.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ jobs:
2424
app-id: ${{ secrets.GH_BOT_APP_ID }}
2525
private-key: ${{ secrets.GH_BOT_APP_PEM_FILE }}
2626

27-
- id: semver
28-
uses: actions/github-script@v8
27+
- uses: actions/github-script@v8
2928
with:
3029
github-token: ${{ steps.bot.outputs.token }}
3130
script: |
@@ -41,3 +40,7 @@ jobs:
4140
// create new tag
4241
await github.rest.git.createRef({ ...context.repo, ref: `refs/tags/v${version}` , sha: context.sha })
4342
}
43+
44+
// mark the major as latest
45+
const { data: { id } } = await github.rest.repos.getReleaseByTag({ ...context.repo, tag: `v${major}` })
46+
await github.rest.repos.updateRelease({ ...context.repo, release_id, })

.releaserc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"releaseRules": [
66
{ "breaking": true, "release": "major" },
77
{ "revert": true, "release": "patch" },
8+
{ "type": "chore", "release": "patch" },
89
{ "type": "build", "release": "patch" },
910
{ "type": "docs", "release": "patch" },
1011
{ "type": "feat", "release": "minor" },
@@ -17,7 +18,7 @@
1718
"preset": "conventionalcommits",
1819
"presetConfig": {
1920
"types": [
20-
{ "type": "chore", "section": "Chores", "hidden": true },
21+
{ "type": "chore", "section": "Chores", "hidden": false },
2122
{ "type": "build", "section": "Build", "hidden": false },
2223
{ "type": "ci", "section": "CI/CD", "hidden": false },
2324
{ "type": "docs", "section": "Docs", "hidden": false },

0 commit comments

Comments
 (0)