Skip to content

Commit f6e24f3

Browse files
authored
Add ability to run workflow manually (#831)
* Add ability to run workflow manually * Also add event to 'Generate env.PATH_PREFIX' step
1 parent a2397ec commit f6e24f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/preview-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
steps:
5656

5757
- name: Checkout
58-
if: contains(fromJSON('["push", "merge_group"]'), github.event_name)
58+
if: contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name)
5959
uses: actions/checkout@v4
6060
with:
6161
ref: ${{ github.event.pull_request.head.sha || github.ref }}
@@ -80,7 +80,7 @@ jobs:
8080
tool-cache: false
8181

8282
- name: Create Deployment
83-
if: github.event_name == 'push' || (steps.check-files.outputs.any_modified == 'true' && startsWith(github.event_name, 'pull_request'))
83+
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || (steps.check-files.outputs.any_modified == 'true' && startsWith(github.event_name, 'pull_request'))
8484
uses: actions/github-script@v7
8585
id: deployment
8686
env:
@@ -122,7 +122,7 @@ jobs:
122122
"merge_group" | "pull_request" | "pull_request_target")
123123
echo "PATH_PREFIX=/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" >> $GITHUB_ENV
124124
;;
125-
"push")
125+
"push" | "workflow_dispatch")
126126
echo "PATH_PREFIX=/${GITHUB_REPOSITORY}/tree/${GITHUB_REF_NAME}" >> $GITHUB_ENV
127127
if [[ ! "${GITHUB_REF_NAME}" =~ ^(main|master|16\.x)$ ]]; then
128128
echo "Unsupported ref name: '${GITHUB_REF_NAME}'";

0 commit comments

Comments
 (0)