Skip to content

Commit 49e54f4

Browse files
authored
Merge pull request #74 from coveo/add-workflow_dispatch-to-sandbox-action
Add workflow dispatch to sandbox action
2 parents be0de09 + 30c0814 commit 49e54f4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/createNewCodeSandBoxDemo.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
name: Create New CodeSandBoxDemo
22
on:
3+
workflow_dispatch:
4+
inputs:
5+
HEADLESS_VERSION:
6+
description: 'Headless version to update to'
7+
required: true
8+
default: ''
39
repository_dispatch:
410
types: [headless_docs_generated]
11+
12+
env:
13+
HEADLESS_VERSION: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.HEADLESS_VERSION || github.event.inputs.HEADLESS_VERSION }}
14+
515
jobs:
616
create-new-demo:
717
runs-on: ubuntu-latest
@@ -21,17 +31,17 @@ jobs:
2131
uses: actions/checkout@v4
2232
- name: Make a new Branch for version
2333
run: |
24-
git checkout -b "version-${{ github.event.client_payload.headless_version }}"
34+
git checkout -b "version-${{ env.HEADLESS_VERSION }}"
2535
env:
2636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2737
- name: Run script to update package.json on new branch
2838
run: |
2939
cd .github/scripts
30-
ruby update_package.rb ${{ github.event.client_payload.headless_version }}
40+
ruby update_package.rb ${{ env.HEADLESS_VERSION }}
3141
cd ../..
3242
git config user.name ${{ secrets.AUTHOR }}
3343
git config user.email ${{ secrets.AUTHOR_EMAIL }}
3444
git status
3545
git add package.json
36-
git commit -m "update package to version ${{ github.event.client_payload.headless_version }}"
37-
git push --set-upstream origin "version-${{ github.event.client_payload.headless_version }}"
46+
git commit -m "update package to version ${{ env.HEADLESS_VERSION }}"
47+
git push --set-upstream origin "version-${{ env.HEADLESS_VERSION }}"

0 commit comments

Comments
 (0)