Skip to content

JobConditionMultipleTriggers #10

JobConditionMultipleTriggers

JobConditionMultipleTriggers #10

name: JobConditionMultipleTriggers
on:
# schedule:
# - cron: '0/5 * * * 1-5'
workflow_dispatch:
inputs:
overwriteThisMorningsBackup:
required: true
type: boolean
default: false
jobs:
test:
name: Job Condition Multiple Triggers
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.overwriteThisMorningsBackup == 'true') }}
runs-on: ubuntu-latest
steps:
- name: echo event_name
run: echo ${{ toJSON(github.event_name) }}
- name: echo input
run: echo ${{ toJSON(github.event.inputs.overwriteThisMorningsBackup) }}
- name: Do some stuff
run: |
echo "Do some stuff $(date +%T)"
sleep 5
echo "Done some stuff $(date +%T)"