@@ -58,31 +58,28 @@ jobs:
58
58
--exclude 'src/test/wiremock/**/*' \
59
59
--exclude 'generated-todos/**' \
60
60
--verbose \
61
- --file pdd.xml
61
+ --format json \
62
+ --file pdd.json
62
63
63
- - name : Remove the current date from pdd.xml
64
- run : sed -i -E '/<time>[-0-9T:Z]+<\/time>/d;/<puzzles/s| date="[-0-9T:Z]+"||' pdd.xml
65
-
66
- # Workaround for #1659
67
- - name : Remove author and email
68
- run : sed -i '/<author>/d;/<email>/d' pdd.xml
64
+ - name : Remove the current date from pdd.json
65
+ run : sed -i '/"date":/d' pdd.json
69
66
70
67
- name : Generate todos-in-code.tsv
71
- run : ./src/main/scripts/ci/pdd-xml -to-json .sh pdd.xml | ./src/main/scripts/ci/ pdd-json-to-tsv.sh > todos-in-code.tsv
68
+ run : ./src/main/scripts/ci/pdd-json -to-tsv .sh < pdd.json > todos-in-code.tsv
72
69
73
70
# @todo #1610 Close an issue or post a comment when a puzzle got removed from code
74
71
# @todo #1610 Post a comment when issue got closed without removing a puzzle
75
72
- name : Check whether there are new todos
76
73
run : |
77
74
PUZZLES_FILES_MODIFIED=no
78
75
79
- if [ ! -f generated-todos/pdd.xml ]; then
80
- echo 'pdd.xml has just been created'
81
- mv pdd.xml generated-todos/pdd.xml
76
+ if [ ! -f generated-todos/pdd.json ]; then
77
+ echo 'pdd.json has just been created'
78
+ mv pdd.json generated-todos/pdd.json
82
79
PUZZLES_FILES_MODIFIED=yes
83
- elif ! diff --brief generated-todos/pdd.xml pdd.xml >/dev/null; then
84
- echo 'pdd.xml has been modified'
85
- mv pdd.xml generated-todos/pdd.xml
80
+ elif ! diff --brief generated-todos/pdd.json pdd.json >/dev/null; then
81
+ echo 'pdd.json has been modified'
82
+ mv pdd.json generated-todos/pdd.json
86
83
PUZZLES_FILES_MODIFIED=yes
87
84
fi
88
85
@@ -97,10 +94,11 @@ jobs:
97
94
fi
98
95
99
96
if [ "$PUZZLES_FILES_MODIFIED" = 'yes' ]; then
100
- printf 'pdd.xml: %d puzzles\n' "$(grep -c '<puzzle>' generated-todos/pdd.xml)"
97
+ printf 'pdd.json: %d puzzles\n' "$(grep -c '<puzzle>' generated-todos/pdd.json)"
98
+ printf 'pdd.json: %d puzzles\n' "$(jq '.puzzles | length' generated-todos/pdd.json)"
101
99
printf 'todos-in-code.tsv: %d todos\n' "$(sed 1d generated-todos/todos-in-code.tsv | wc -l)"
102
100
else
103
- echo 'neither pdd.xml nor todos-in-code.tsv have been modified'
101
+ echo 'neither pdd.json nor todos-in-code.tsv have been modified'
104
102
fi
105
103
106
104
# Make variable available for the next steps
@@ -168,7 +166,7 @@ jobs:
168
166
NEW_COMMIT_MSG : " chore: processed ${{ env.COMMIT_MSG }}"
169
167
working-directory : generated-todos
170
168
run : |
171
- git commit pdd.xml todos-in-code.tsv -m "$NEW_COMMIT_MSG"
169
+ git commit pdd.json todos-in-code.tsv -m "$NEW_COMMIT_MSG"
172
170
git push
173
171
174
172
- name : Commit updated mapping
@@ -184,6 +182,6 @@ jobs:
184
182
- name : Cleanup
185
183
if : always()
186
184
run : |
187
- [ ! -f pdd.xml ] || rm -fv pdd.xml
185
+ [ ! -f pdd.json ] || rm -fv pdd.json
188
186
[ ! -f todos-in-code.tsv ] || rm -fv todos-in-code.tsv
189
187
[ ! -d generated-todos ] || git worktree remove generated-todos
0 commit comments