Skip to content

Commit

Permalink
workflow_dispatch input event name (#55)
Browse files Browse the repository at this point in the history
* workflow_dispatch input event name

* fix
  • Loading branch information
srz-zumix authored Sep 1, 2022
1 parent bf70c2f commit a3f2f08
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ on:
watch:
workflow_dispatch:
inputs:
name:
description: 'Name'
event:
description: 'event name'
default: 'workflow_dispatch'
required: true
workflow_run:
workflows: [Lint]
Expand All @@ -41,6 +42,7 @@ jobs:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACT_EVENT_NAME: ${{ inputs.event || github.event_name }}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -73,11 +75,12 @@ jobs:
echo "${GITHUB_EVENT_CONTEXT}" > github_event.json
- name: Create act event.json
run: |
gh act "${{ github.event_name }}" -e gh_act_event_raw.json -j noop
gh act "${ACT_EVENT_NAME}" -e gh_act_event_raw.json -j noop
jq . < gh_act_event_raw.json > gh_act_event.json
- name: Diff
run: |
diff github_event.json gh_act_event.json || :
if: github.event_name == env.ACT_EVENT_NAME

noop:
runs-on: ubuntu-latest
Expand Down

0 comments on commit a3f2f08

Please sign in to comment.