Skip to content

Commit 6ee39f4

Browse files
committed
fixed the deploy
1 parent bcb7cda commit 6ee39f4

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ name: Create Release
33
on:
44
push:
55
tags:
6-
- '*.*.*'
7-
branches:
8-
- master
6+
- '*.*.*' # Match semantic versioning tags
7+
# Removed branches trigger to ensure it only runs on tags
8+
# branches:
9+
# - master
910

1011
jobs:
1112
create_release:
12-
if: github.ref == 'refs/heads/master'
13+
# No need to check against branches, workflow only triggers on tags
1314
runs-on: ubuntu-latest
1415
steps:
1516
- uses: actions/checkout@v3
@@ -40,10 +41,15 @@ jobs:
4041
run: |
4142
changelog_section_start="== Changelog =="
4243
readme_file="$readme_file"
43-
#plugin_version="${{ github.ref_name }}" # Assuming the tag is the version
44-
plugin_version="${GITHUB_REF#refs/tags/}"
45-
46-
echo "DEBUG: Plugin latest version found $plugin_version."
44+
45+
# Extract the tag name from GITHUB_REF (plugin_version)
46+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
47+
plugin_version="${GITHUB_REF#refs/tags/}"
48+
echo "DEBUG: Plugin latest version found: $plugin_version."
49+
else
50+
echo "::error::This workflow must be triggered by a tag push."
51+
exit 1
52+
fi
4753
4854
in_changelog=0
4955
found_version=0
@@ -105,8 +111,7 @@ jobs:
105111
# Write the release notes with actual line breaks
106112
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
107113
echo -e "$release_notes" >> $GITHUB_ENV
108-
echo "EOF" >> $GITHUB_ENV
109-
114+
echo "EOF" >> $GITHUB_ENV
110115
111116
- name: Create zip file
112117
run: |
@@ -137,4 +142,4 @@ jobs:
137142
upload_url: ${{ steps.create_release.outputs.upload_url }}
138143
asset_path: ./${{ env.repo_name }}.zip
139144
asset_name: ${{ env.repo_name }}.zip
140-
asset_content_type: application/zip
145+
asset_content_type: application/zip

0 commit comments

Comments
 (0)