07 - Using Expressions #3
This file contains 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
name: 07 - Using Expressions | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
debug: | |
type: boolean | |
default: false | |
jobs: | |
echo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: '[debug] Print start-up data' | |
if: ${{ inputs.debug }} | |
run: | | |
echo "Triggered by: ${{ github.event_name }}" | |
echo "Branch: ${{ github.ref }}" | |
echo "Commit SHA: ${{ github.sha }}" | |
echo "Runner OS: ${{ runner.os }}" | |
- name: '[debug] Print when triggered from main' | |
if: ${{ inputs.debug && github.ref == 'refs/heads/main' }} | |
run: echo "I was triggered from main" | |
- name: Greeting | |
run: echo "Hello, world" |