Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GuillaumeFalourd/1b3755612299523e2602bdc35df7441b to your computer and use it in GitHub Desktop.
Save GuillaumeFalourd/1b3755612299523e2602bdc35df7441b to your computer and use it in GitHub Desktop.
Example checking if an output contains or not a specific value
name: Conditional Workflow
on:
workflow_dispatch:
jobs:
job1:
runs-on: ubuntu-latest
steps:
- id: step1
run: echo "::set-output name=test::hello"
- name: step 2
if: contains(steps.step1.outputs.test, 'hello')
run: echo 'is executed'
- name: step 3
if: contains(steps.step1.outputs.test, 'not_hello')
run: echo 'not executed'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment