-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
describe JSON syntax check and strong typing for
fromJSON
as a sepa…
…rate example
- Loading branch information
Showing
5 changed files
with
71 additions
and
15 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test.yaml:6:18: property "mac" is not defined in object type {linux: string; win: string} [expression] | ||
test.yaml:9:24: format string "{0}{1}" does not contain placeholder {2}. remove argument which is unused in the format string [expression] | ||
test.yaml:11:24: format string "{0}{1}{2}" contains placeholder {2} but only 2 arguments are given to format [expression] | ||
test.yaml:14:31: broken JSON string is passed to fromJSON() at offset 23: unexpected end of JSON input [expression] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
on: push | ||
|
||
jobs: | ||
test: | ||
# ERROR: Key 'mac' does not exist in the object returned by the fromJSON() | ||
runs-on: ${{ fromJSON('{"win":"windows-latest","linux":"ubuntul-latest"}')['mac'] }} | ||
steps: | ||
# ERROR: {2} is missing in the first argument of format() | ||
- run: echo "${{ format('{0}{1}', 1, 2, 3) }}" | ||
# ERROR: Argument for {2} is missing in the arguments of format() | ||
- run: echo "${{ format('{0}{1}{2}', 1, 2) }}" | ||
- run: echo This is special branch! | ||
# ERROR: Broken JSON string. Special check for fromJSON() | ||
if: contains(fromJson('["main","release","dev"'), github.ref_name) |
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
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