File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -x
4
+ set -e
5
+ set -u
6
+
1
7
export NEW_VERSION=" ${1} "
8
+ export BRANCH_NAME=" release-v${NEW_VERSION} "
2
9
export GITHUB_ACTION_PATH=" ${2} "
3
10
export RELEASE_BODY=" $( awk -v version=" ${NEW_VERSION} " -f ${GITHUB_ACTION_PATH} /scripts/show-changelog.awk CHANGELOG.md) "
4
11
5
- node " ${GITHUB_ACTION_PATH} /scripts/update-package-version.js"
6
-
7
12
git config user.name github-actions
8
13
git config user.email
[email protected]
9
14
10
- if ! (git add . && git commit -m " Release ${NEW_VERSION} " && git push);
15
+ node " ${GITHUB_ACTION_PATH} /scripts/update-package-version.js"
16
+
17
+ git checkout -b " ${BRANCH_NAME} "
18
+
19
+ if ! (git add . && git commit -m " ${NEW_VERSION} " && git push);
11
20
then
12
- echo " No changes"
21
+ echo " Error: No changes detected."
22
+ exit 1
13
23
fi
14
24
15
25
hub pull-request \
16
26
--draft \
17
27
--message " ${NEW_VERSION} RC" --message " ${RELEASE_BODY} " \
18
28
--base " main" \
19
- --head " ${NEW_VERSION } " ;
29
+ --head " ${BRANCH_NAME } " ;
You can’t perform that action at this time.
0 commit comments