Skip to content

Commit 7335f67

Browse files
committed
refactor: rename CREATE_COMMIT variable to PUZZLES_FILES_MODIFIED
Relate to #1610
1 parent db947fd commit 7335f67

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/todos-extract-from-code.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -80,36 +80,36 @@ jobs:
8080

8181
- name: Check whether there are new todos
8282
run: |
83-
CREATE_COMMIT=no
83+
PUZZLES_FILES_MODIFIED=no
8484
8585
if [ ! -f generated-todos/pdd.xml ]; then
8686
echo 'pdd.xml has just been created'
87-
CREATE_COMMIT=yes
87+
PUZZLES_FILES_MODIFIED=yes
8888
elif ! diff --brief generated-todos/pdd.xml pdd.xml >/dev/null; then
8989
echo 'pdd.xml has been modified'
90-
CREATE_COMMIT=yes
90+
PUZZLES_FILES_MODIFIED=yes
9191
fi
9292
9393
if [ ! -f generated-todos/todos-in-code.tsv ]; then
9494
echo 'todos-in-code.tsv has just been created'
95-
CREATE_COMMIT=yes
95+
PUZZLES_FILES_MODIFIED=yes
9696
elif ! diff --brief generated-todos/todos-in-code.tsv todos-in-code.tsv >/dev/null; then
9797
echo 'todos-in-code.tsv has been modified'
98-
CREATE_COMMIT=yes
98+
PUZZLES_FILES_MODIFIED=yes
9999
fi
100100
101-
if [ "$CREATE_COMMIT" = 'yes' ]; then
101+
if [ "$PUZZLES_FILES_MODIFIED" = 'yes' ]; then
102102
printf 'pdd.xml: %d puzzles\n' "$(grep -c '<puzzle>' pdd.xml)"
103103
printf 'todos-in-code.tsv: %d todos\n' "$(sed 1d todos-in-code.tsv | wc -l)"
104104
else
105105
echo 'neither pdd.xml nor todos-in-code.tsv have been modified'
106106
fi
107107
108108
# Make variable available for the next steps
109-
echo "CREATE_COMMIT=$CREATE_COMMIT" | tee -a "$GITHUB_ENV"
109+
echo "PUZZLES_FILES_MODIFIED=$PUZZLES_FILES_MODIFIED" | tee -a "$GITHUB_ENV"
110110
111111
- name: Collect information about the original commit
112-
if: env.CREATE_COMMIT == 'yes'
112+
if: env.PUZZLES_FILES_MODIFIED == 'yes'
113113
run: |
114114
# Make variables available for the next steps
115115
(
@@ -119,7 +119,7 @@ jobs:
119119
) | tee -a "$GITHUB_ENV"
120120
121121
- name: Commit the changes
122-
if: env.CREATE_COMMIT == 'yes'
122+
if: env.PUZZLES_FILES_MODIFIED == 'yes'
123123
env:
124124
GIT_AUTHOR_NAME: "GitHub Action on behalf of ${{ env.AUTHOR_NAME }}"
125125
GIT_COMMITTER_NAME: "GitHub Action on behalf of ${{ env.AUTHOR_NAME }}"

0 commit comments

Comments
 (0)