Skip to content

Commit 582cfb3

Browse files
committed
ci: try to create new issues when files weren't modified but there is some puzzles without issues
Part of #1610
1 parent 571541e commit 582cfb3

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Diff for: .github/workflows/todos-extract-from-code.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,29 @@ jobs:
123123
git commit --all -m "$NEW_COMMIT_MSG"
124124
git push
125125
126+
# It's possible that for some puzzles we haven't created issues yet
127+
# (because of network, rate limit or other kind of errors)
128+
- name: Check whether there are puzzles without related issues
129+
if: env.PUZZLES_FILES_MODIFIED == 'no'
130+
working-directory: generated-todos
131+
run: |
132+
NEW_PIZZLES="$(comm -23 <(cut -d$'\t' -f1 todos-in-code.tsv | sort) <(cut -d$'\t' -f1 todos-on-github.tsv | sort))"
133+
if [ -n "$NEW_PIZZLES" ]; then
134+
echo "Found puzzles without related issues:"
135+
echo "$NEW_PUZZLES" | while read PUZZLE_ID; do
136+
grep "$PUZZLE_ID" todos-in-code.tsv | IFS=$'\t' read SKIP_PUZZLE_ID TICKET TITLE REST
137+
echo "$PUZZLE_ID from #$TICKET: $(echo "$TITLE" | sed 's|^"||;s|"$||;s|""|"|'g)"
138+
done
139+
HAVE_PUZZLES_WITHOUT_ISSUES=yes
140+
else
141+
HAVE_PUZZLES_WITHOUT_ISSUES=no
142+
fi
143+
144+
# Make variable available for the next steps
145+
echo "HAVE_PUZZLES_WITHOUT_ISSUES=$HAVE_PUZZLES_WITHOUT_ISSUES" | tee -a "$GITHUB_ENV"
146+
126147
- name: Connect todos to the issues
127-
if: env.PUZZLES_FILES_MODIFIED == 'yes'
148+
if: env.PUZZLES_FILES_MODIFIED == 'yes' || env.HAVE_PUZZLES_WITHOUT_ISSUES == 'yes'
128149
env:
129150
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130151
run: ./src/main/scripts/ci/connect-todos-to-issues.sh generated-todos/todos-in-code.tsv

0 commit comments

Comments
 (0)