generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 39
33 lines (30 loc) · 1.2 KB
/
test_fromJSON.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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