Skip to content

Commit b7234ae

Browse files
committed
ci: add commits to the release text
1 parent b179da1 commit b7234ae

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/swan-ci-ca.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
1921

2022
- name: Set environnment package name and version
2123
run: |
22-
PACKAGE_NAME=$(echo ${GITHUB_REF#refs/*/} | cut -d / -f 1)
24+
PACKAGE_TAG=${GITHUB_REF#refs/*/}
25+
PACKAGE_NAME=$(echo $PACKAGE_TAG | cut -d / -f 1)
2326
24-
echo "PACKAGE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
27+
echo "PACKAGE_TAG=$PACKAGE_TAG" >> $GITHUB_ENV
2528
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
26-
echo "PACKAGE_VERSION=$(echo ${GITHUB_REF#refs/*/} | cut -d / -f 2)" >> $GITHUB_ENV
29+
echo "PACKAGE_VERSION=$(echo $PACKAGE_TAG | cut -d / -f 2)" >> $GITHUB_ENV
2730
2831
cd $PACKAGE_NAME
2932
if [ -f 'package.json' ]; then
@@ -34,6 +37,11 @@ jobs:
3437
echo "PACKAGE_JAVA=$(echo 1)" >> $GITHUB_ENV
3538
fi
3639
40+
PREV_TAG=$(git describe --tags --match "$PACKAGE_NAME*" --abbrev=0 --exclude "$PACKAGE_TAG")
41+
EXT_LOWERCASE=$(echo $PACKAGE_NAME | tr '[:upper:]' '[:lower:]')
42+
git --no-pager log $PREV_TAG..HEAD --pretty=format:"- %B" -- $PACKAGE_NAME | sed -r "s/($EXT_LOWERCASE|$PACKAGE_NAME): //g" | sed -r "s/\*/ \*/g" > /tmp/release_body.md
43+
44+
3745
- name: Install Python
3846
uses: actions/setup-python@v1
3947
with:
@@ -79,8 +87,7 @@ jobs:
7987
with:
8088
tag_name: ${{ github.ref }}
8189
release_name: ${{ github.ref }}
82-
body: |
83-
${{github.event.head_commit.message}}
90+
body_path: /tmp/release_body.md
8491
draft: false
8592
prerelease: false
8693

0 commit comments

Comments
 (0)