File tree 3 files changed +28
-3
lines changed
3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change
1
+ const { execSync } = require ( 'node:child_process' )
2
+
3
+ const getSignedOffBy = ( ) => {
4
+ const gitUserName = execSync ( 'git config user.name' ) . toString ( 'utf-8' ) . trim ( )
5
+ const gitEmail = execSync ( 'git config user.email' ) . toString ( 'utf-8' ) . trim ( )
6
+
7
+ return `Signed-off-by: ${ gitUserName } <${ gitEmail } >`
8
+ }
9
+
10
+ const getAddMessage = async ( changeset ) => {
11
+ return `docs(changeset): ${ changeset . summary } \n\n${ getSignedOffBy ( ) } \n`
12
+ }
13
+
14
+ const getVersionMessage = async ( ) => {
15
+ return `chore(release): new version\n\n${ getSignedOffBy ( ) } \n`
16
+ }
17
+
18
+ module . exports = {
19
+ getAddMessage,
20
+ getVersionMessage,
21
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" :
" https://unpkg.com/@changesets/[email protected] /schema.json" ,
3
3
"changelog" : " @changesets/cli/changelog" ,
4
+ "commit" : " ./commit" ,
4
5
"privatePackages" : false ,
5
6
"fixed" : [[" @animo-id/*" ]],
6
7
"access" : " public" ,
Original file line number Diff line number Diff line change 11
11
release-stable :
12
12
runs-on : ubuntu-20.04
13
13
name : Release Stable
14
+ outputs :
15
+ published : ${{ steps.changesets.outputs.published }}
14
16
steps :
15
17
- name : Checkout Repo
16
18
uses : actions/checkout@v4
25
27
- name : Install Dependencies
26
28
run : pnpm install --frozen-lockfile
27
29
28
- - name : Create Release Pull Request
30
+ - name : Create Release Pull Request or Publish to npm
29
31
id : changesets
30
32
uses : changesets/action@v1
31
33
with :
@@ -42,15 +44,16 @@ jobs:
42
44
run : echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
43
45
44
46
- name : Create Github Release
45
- if : " startsWith(github.event.head_commit.message, 'chore(release): new version') "
47
+ if : steps.changesets.outputs.published == 'true'
46
48
uses : softprops/action-gh-release@v2
47
49
with :
48
50
tag_name : v${{ env.CURRENT_PACKAGE_VERSION }}
49
51
50
52
release-unstable :
51
53
runs-on : ubuntu-20.04
52
54
name : Release Unstable
53
- if : " always() && github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version')"
55
+ needs : release-stable
56
+ if : always() && github.event_name == 'push' && needs.release-stable.outputs.published == 'false'
54
57
steps :
55
58
- name : Checkout Repo
56
59
uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments