File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,22 @@ jobs:
4040 run : |
4141 START_LINE=$(grep -n "== Changelog ==" readme.txt | cut -d : -f 1)
4242 END_LINE=$(grep -n "= ${{ env.plugin_version }} =" readme.txt | cut -d : -f 1)
43+ if [ -z "$START_LINE" ] || [ -z "$END_LINE" ]; then
44+ echo "Changelog not found"
45+ exit 1
46+ fi
4347 sed -n "${START_LINE},${END_LINE}p" readme.txt | sed '1d;$d' > CHANGELOG.txt
44- echo "changelog=$(cat CHANGELOG.txt)" >> $GITHUB_ENV
48+ CHANGELOG_CONTENT=$(cat CHANGELOG.txt)
49+ if [ -z "$CHANGELOG_CONTENT" ]; then
50+ echo "Changelog content is empty"
51+ exit 1
52+ fi
53+ echo "changelog=$CHANGELOG_CONTENT" >> $GITHUB_ENV
4554
4655 - name : Create zip file
4756 run : |
4857 REPO_NAME=$(basename `git rev-parse --show-toplevel`)
49- zip -r ${REPO_NAME}.zip . -x '*.git*' -x '*.github*' -x '*.distignore*'
58+ zip -r ${REPO_NAME}.zip . -x '*.git*' -x '*.github*' -x '*.distignore*' -x 'CHANGELOG.txt'
5059 echo "repo_name=${REPO_NAME}" >> $GITHUB_ENV
5160
5261 - name : Create Release
5564 env :
5665 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5766 with :
58- tag_name : ${{ env.plugin_version }} # Use the plugin version as the tag name
67+ tag_name : ${{ env.latest_tag }}
5968 release_name : " Release ${{ env.plugin_version }}"
6069 body : ${{ env.changelog }}
6170 draft : false
You can’t perform that action at this time.
0 commit comments