Skip to content

Commit 8f395c1

Browse files
ci(release): Add option to deploy or not a release
1 parent 8803e6c commit 8f395c1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Deploy and Create Release
2-
# example: gh workflow run release.yml -f tag_name=v1.1.4
2+
# example: gh workflow run release.yml -f tag_name=v1.1.4 -f deploy_to_wordpress=true
33
on:
44
workflow_dispatch:
5-
inputs:
6-
tag_name:
7-
default: ""
8-
deploy_to_wordpress:
9-
default: true
5+
tag_name:
6+
type: string
7+
required: true
8+
deploy_to_wordpress:
9+
type: boolean
10+
description: Deploy to WordPress
11+
default: true
12+
required: true
1013

1114
jobs:
1215
deploy-create-release:
@@ -99,7 +102,7 @@ jobs:
99102
})
100103
101104
- name: WordPress Plugin Deploy
102-
if: github.event.inputs.deploy_to_wordpress
105+
if: github.event.inputs.deploy_to_wordpress == 'true'
103106
id: deploy
104107
uses: 10up/action-wordpress-plugin-deploy@2.0.0
105108
with:
@@ -118,7 +121,7 @@ jobs:
118121
119122
120123
- name: Create release ${{ env.VERSION_NUMBER }} with Wordpress zip
121-
if: github.event.inputs.deploy_to_wordpress
124+
if: github.event.inputs.deploy_to_wordpress == 'true'
122125
uses: softprops/action-gh-release@v1
123126
with:
124127
files: crowdsec.zip
@@ -129,7 +132,7 @@ jobs:
129132
prerelease: false
130133

131134
- name: Create release ${{ env.VERSION_NUMBER }} without Wordpress zip
132-
if: !github.event.inputs.deploy_to_wordpress
135+
if: github.event.inputs.deploy_to_wordpress != 'true'
133136
uses: softprops/action-gh-release@v1
134137
with:
135138
body_path: CHANGELOG.txt

0 commit comments

Comments
 (0)