Skip to content

Commit a59c505

Browse files
committed
Update spellcheck comment
1 parent e6fce04 commit a59c505

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/spelling.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,28 @@ jobs:
119119
echo "Checking spelling in $file"
120120
python3 -c "import yaml; config = yaml.safe_load(open('.pyspelling.yml')); new_matrix = [matrix.copy() for matrix in config['matrix'] if (('python' in matrix['name'].lower() and '$file'.endswith('.py')) or ('rest' in matrix['name'].lower() and '$file'.endswith('.rst')) or ('markdown' in matrix['name'].lower() and '$file'.endswith('.md'))) and not matrix.update({'sources': ['$file']})]; config['matrix'] = new_matrix; yaml.dump(config, open('temp_config.yml', 'w'))"
121121
122-
if ! OUTPUT=$(pyspelling -c temp_config.yml 2>&1); then
122+
if OUTPUT=$(pyspelling -c temp_config.yml 2>&1); then
123+
echo "No spelling errors found in $file"
124+
else
123125
FINAL_EXIT_CODE=1
124-
SPELLCHECK_LOG="${SPELLCHECK_LOG}### ${file}\n${OUTPUT}\n\n"
126+
echo "Spelling errors found in $file:"
127+
echo "$OUTPUT"
128+
SPELLCHECK_LOG+="### $file\n$OUTPUT\n\n"
125129
fi
126130
fi
127131
done
128132
129-
{
130-
echo "spell_failed=${FINAL_EXIT_CODE}" >> $GITHUB_OUTPUT
131-
echo "spell_log<<EOF" >> $GITHUB_OUTPUT
132-
echo "${SPELLCHECK_LOG}" >> $GITHUB_OUTPUT
133-
echo "EOF" >> $GITHUB_OUTPUT
134-
}
133+
# Save the results to GITHUB_OUTPUT
134+
echo "spell_failed=$FINAL_EXIT_CODE" >> $GITHUB_OUTPUT
135+
echo "spell_log<<SPELLEOF" >> $GITHUB_OUTPUT
136+
echo "$SPELLCHECK_LOG" >> $GITHUB_OUTPUT
137+
echo "SPELLEOF" >> $GITHUB_OUTPUT
135138
136139
if [ $FINAL_EXIT_CODE -ne 0 ]; then
140+
echo "Spell check failed! See above for details."
137141
exit 1
138142
fi
143+
139144
140145
- name: Check for existing comment
141146
if: |

0 commit comments

Comments
 (0)