Skip to content

Commit d106ee3

Browse files
committed
refactor: rename CREATE_COMMIT variable to PUZZLES_FILES_MODIFIED
Relate to #1610
1 parent 947f7b2 commit d106ee3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -67,36 +67,36 @@ jobs:
6767

6868
- name: Check whether there are new todos
6969
run: |
70-
CREATE_COMMIT=no
70+
PUZZLES_FILES_MODIFIED=no
7171
7272
if [ ! -f generated-todos/pdd.xml ]; then
7373
echo 'pdd.xml has just been created'
74-
CREATE_COMMIT=yes
74+
PUZZLES_FILES_MODIFIED=yes
7575
elif ! diff --brief generated-todos/pdd.xml pdd.xml >/dev/null; then
7676
echo 'pdd.xml has been modified'
77-
CREATE_COMMIT=yes
77+
PUZZLES_FILES_MODIFIED=yes
7878
fi
7979
8080
if [ ! -f generated-todos/todos-in-code.tsv ]; then
8181
echo 'todos-in-code.tsv has just been created'
82-
CREATE_COMMIT=yes
82+
PUZZLES_FILES_MODIFIED=yes
8383
elif ! diff --brief generated-todos/todos-in-code.tsv todos-in-code.tsv >/dev/null; then
8484
echo 'todos-in-code.tsv has been modified'
85-
CREATE_COMMIT=yes
85+
PUZZLES_FILES_MODIFIED=yes
8686
fi
8787
88-
if [ "$CREATE_COMMIT" = 'yes' ]; then
88+
if [ "$PUZZLES_FILES_MODIFIED" = 'yes' ]; then
8989
printf 'pdd.xml: %d puzzles\n' "$(grep -c '<puzzle>' pdd.xml)"
9090
printf 'todos-in-code.tsv: %d todos\n' "$(sed 1d todos-in-code.tsv | wc -l)"
9191
else
9292
echo 'neither pdd.xml nor todos-in-code.tsv have been modified'
9393
fi
9494
9595
# Make variable available for the next steps
96-
echo "CREATE_COMMIT=$CREATE_COMMIT" | tee -a "$GITHUB_ENV"
96+
echo "PUZZLES_FILES_MODIFIED=$PUZZLES_FILES_MODIFIED" | tee -a "$GITHUB_ENV"
9797
9898
- name: Collect information about the original commit
99-
if: env.CREATE_COMMIT == 'yes'
99+
if: env.PUZZLES_FILES_MODIFIED == 'yes'
100100
run: |
101101
# Make variables available for the next steps
102102
(
@@ -106,7 +106,7 @@ jobs:
106106
) | tee -a "$GITHUB_ENV"
107107
108108
- name: Commit the changes
109-
if: env.CREATE_COMMIT == 'yes'
109+
if: env.PUZZLES_FILES_MODIFIED == 'yes'
110110
env:
111111
GIT_AUTHOR_NAME: "GitHub Action on behalf of ${{ env.AUTHOR_NAME }}"
112112
GIT_COMMITTER_NAME: "GitHub Action on behalf of ${{ env.AUTHOR_NAME }}"

0 commit comments

Comments
 (0)