Skip to content

Example Workflow

Example Workflow #1

Workflow file for this run

name: Example Workflow
on: workflow_dispatch
jobs:
example-job:
runs-on: ubuntu-latest
env:
BOOLEAN: "true"
steps:
- name: Check BOOLEAN
if: ${{ fromJSON(env.BOOLEAN) }}
run: |
BOOLEAN_VALUE=$(jq -n --argjson boolean "$BOOLEAN" '$boolean')
echo "BOOLEAN_VALUE is $BOOLEAN_VALUE"
if [ "$BOOLEAN_VALUE" = "true" ]; then
echo "The BOOLEAN_VALUE is true"
else
echo "The BOOLEAN_VALUE is not true"
fi
- name: Check NOT BOOLEAN
if: ${{ fromJSON(env.BOOLEAN) }}
run: |
BOOLEAN_VALUE=$(jq -n --argjson boolean "$BOOLEAN" '$boolean')
NOT_BOOLEAN_VALUE=$(jq -n --argjson boolean "$BOOLEAN" '!$boolean')
echo "BOOLEAN_VALUE is $BOOLEAN_VALUE"
echo "NOT_BOOLEAN_VALUE is $NOT_BOOLEAN_VALUE"
if [ "$NOT_BOOLEAN_VALUE" = "false" ]; then
echo "The NOT_BOOLEAN_VALUE is false"
else
echo "The NOT_BOOLEAN_VALUE is not false"
fi