Workflow Dispatch #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ | |
| name: Workflow Dispatch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| name: | |
| description: 'Person to greet' | |
| required: true | |
| default: 'Mona the Octocat' | |
| home: | |
| description: 'location' | |
| required: false | |
| default: 'The Octoverse' | |
| jobs: | |
| manually-triggered-workflow: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| echo "Hello ${{ inputs.name }}!" | |
| echo "- in ${{ inputs.home }}!" | |
| - if: inputs.name == 'Mona' | |
| run: echo "Name is Mona" | |
| - if: inputs.name != 'Mona' | |
| run: echo "Name is not Mona" | |
| - if: contains(inputs.name, 'Mona') | |
| run: echo "Name contains Mona" | |
| - if: contains(inputs.name, 'Mona') == false | |
| run: echo "Name does not contain Mona" | |
| # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
| # on: | |
| # workflow_dispatch: | |
| # inputs: | |
| # logLevel: | |
| # description: 'Log level' | |
| # required: true | |
| # default: 'warning' | |
| # type: choice | |
| # options: | |
| # - info | |
| # - warning | |
| # - debug | |
| # tags: | |
| # description: 'Test scenario tags' | |
| # required: false | |
| # type: boolean | |
| # environment: | |
| # description: 'Environment to run tests against' | |
| # type: environment | |
| # required: true | |
| # | |
| # jobs: | |
| # log-the-inputs: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - run: | | |
| # echo "Log level: $LEVEL" | |
| # echo "Tags: $TAGS" | |
| # echo "Environment: $ENVIRONMENT" | |
| # env: | |
| # LEVEL: ${{ inputs.logLevel }} | |
| # TAGS: ${{ inputs.tags }} | |
| # ENVIRONMENT: ${{ inputs.environment }} | |
| # https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows/ | |
| # name: Mixed inputs | |
| # | |
| # on: | |
| # workflow_dispatch: | |
| # inputs: | |
| # name: | |
| # type: choice | |
| # description: Who to greet | |
| # options: | |
| # - monalisa | |
| # - cschleiden | |
| # message: | |
| # required: true | |
| # use-emoji: | |
| # type: boolean | |
| # description: Include 🎉🤣 emojis | |
| # environment: | |
| # type: environment | |
| # | |
| # jobs: | |
| # greet: | |
| # runs-on: ubuntu-latest | |
| # | |
| # steps: | |
| # - name: Send greeting | |
| # run: echo "${{ github.event.inputs.message }} ${{ fromJSON('["", "🥳"]')[github.event.inputs.use-emoji == 'true'] }} ${{ github.event.inputs.name }}" |