Skip to content

Commit 2a273f9

Browse files
committed
ci: release builds only from main branch
Signed-off-by: Vedant K <gamemaker0042@gmail.com>
1 parent 9e90719 commit 2a273f9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: NodeJS CI
22

33
# Triggers the workflow on push or pull request events but only for the main branch
4-
on: [push, pull_request]
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main, develop]
59

610
# This workflow contains three jobs: run tests, build and release
711
jobs:
@@ -112,7 +116,7 @@ jobs:
112116
id: check-version
113117
- name: Create release
114118
# Run it only if the version has been changed
115-
if: ${{ steps.check-version.outputs.version != steps.check-version.outputs.previous_version }}
119+
if: ${{ steps.check-version.outputs.version != steps.check-version.outputs.previous_version && github.ref == 'refs/heads/main' }}
116120
uses: softprops/action-gh-release@v1
117121
with:
118122
body_path: release-notes.md

0 commit comments

Comments
 (0)