Skip to content

Commit a7bec4d

Browse files
committed
workflow update
1 parent 95d2586 commit a7bec4d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ on:
44
push:
55
tags:
66
- '*.*.*'
7-
branches:
8-
- master
97

108
jobs:
119
create_release:
12-
if: github.ref == 'refs/heads/master'
1310
runs-on: ubuntu-latest
1411
steps:
1512
- uses: actions/checkout@v3
@@ -26,7 +23,6 @@ jobs:
2623
break
2724
fi
2825
done
29-
source $GITHUB_ENV
3026
if [ -z "$readme_file" ]; then
3127
echo "::error::Readme file not found."
3228
exit 1
@@ -36,11 +32,12 @@ jobs:
3632
id: release_notes
3733
run: |
3834
changelog_section_start="== Changelog =="
39-
readme_file="$readme_file"
35+
readme_file="${{ env.readme_file }}"
4036
plugin_version="${{ github.ref_name }}" # Assuming the tag is the version
4137
4238
in_changelog=0
4339
release_notes=""
40+
4441
while IFS= read -r line; do
4542
if [[ "$line" == "$changelog_section_start" ]]; then
4643
in_changelog=1
@@ -61,18 +58,21 @@ jobs:
6158
exit 1
6259
fi
6360
64-
# Use the <<EOF syntax to handle multi-line environment variables correctly
61+
# Save release notes to GITHUB_ENV in a safe way
6562
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
66-
echo -e "$release_notes" >> $GITHUB_ENV
63+
printf "%s\n" "$release_notes" >> $GITHUB_ENV
6764
echo "EOF" >> $GITHUB_ENV
68-
source $GITHUB_ENV # Ensure the environment variable is available for subsequent steps
65+
66+
- name: Debug Release Notes
67+
run: |
68+
echo "Extracted Release Notes:"
69+
echo "${{ env.RELEASE_NOTES }}"
6970
7071
- name: Create zip file
7172
run: |
7273
REPO_NAME=$(basename `git rev-parse --show-toplevel`)
7374
zip -r ${REPO_NAME}.zip . -x '*.git*' -x '.github/*' -x '*.distignore*' -x 'CHANGELOG.txt'
7475
echo "repo_name=${REPO_NAME}" >> $GITHUB_ENV
75-
source $GITHUB_ENV # Ensure the environment variable is available for subsequent steps
7676
7777
- name: Create Release
7878
id: create_release
@@ -94,4 +94,4 @@ jobs:
9494
upload_url: ${{ steps.create_release.outputs.upload_url }}
9595
asset_path: ./${{ env.repo_name }}.zip
9696
asset_name: ${{ env.repo_name }}.zip
97-
asset_content_type: application/zip
97+
asset_content_type: application/zip

0 commit comments

Comments
 (0)