Skip to content

07 - Using Expressions | DEBUG - OFF #7

07 - Using Expressions | DEBUG - OFF

07 - Using Expressions | DEBUG - OFF #7

name: 07 - Using Expressions
run-name: 07 - Using Expressions | DEBUG - ${{ inputs.debug && 'ON' || 'OFF' }}
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"