Example Workflow #1
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: 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 |