Skip to content

Commit 9f4da5d

Browse files
committed
Create a release when the workflow is not manually triggered
1 parent 9035ab2 commit 9f4da5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/npm-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
9595
- name: Create new tag
9696
id: create_tag
97-
if: github.ref == 'refs/heads/main'
97+
if: github.ref == 'refs/heads/main' && github.event_name != 'release'
9898
run: |
9999
tag_name="web-api-v${{ steps.new_version.outputs.version }}"
100100
echo "Tag name: $tag_name"
@@ -103,13 +103,13 @@ jobs:
103103
104104
- name: Push new tag
105105
id: push_tag
106-
if: github.ref == 'refs/heads/main'
106+
if: github.ref == 'refs/heads/main' && github.event_name != 'release'
107107
run: |
108108
git push origin --tags
109109
110110
- name: "Build Changelog"
111111
id: build_changelog
112-
if: github.ref == 'refs/heads/main'
112+
if: github.ref == 'refs/heads/main' && github.event_name != 'release'
113113
uses: mikepenz/release-changelog-builder-action@v4
114114
with:
115115
configurationJson: |
@@ -127,7 +127,7 @@ jobs:
127127

128128
- name: Create a GitHub Release
129129
id: create_release
130-
if: github.ref == 'refs/heads/main'
130+
if: github.ref == 'refs/heads/main' && github.event_name != 'release'
131131
uses: actions/create-release@v1
132132
env:
133133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)