Revamp failure test for spec linting action (#291)

This commit is contained in:
Thomas Crain 2020-10-27 16:03:15 -07:00 коммит произвёл GitHub
Родитель 6ab37d60be
Коммит 5c9c49d9d2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 13 добавлений и 10 удалений

23
.github/workflows/lint-specs.yml поставляемый
Просмотреть файл

@ -78,19 +78,22 @@ jobs:
# We don't want this tool to have a low signal-to-noise ratio
- name: Lint changed spec files
run: |
mkdir -p linted_specs
spec-cleaner -o linted_specs ${{ env.updated-specs }}
[ -n "$(ls -A linted_specs)" ] \
&& echo "Specs are not correctly formatted." \
&& echo "Linting output is available in the linted_specs artifact." \
&& echo "Please properly format your specs according to that output before merging." \
&& echo "A diff of the changes required is printed below:" \
&& spec-cleaner -d --diff-prog="git --no-pager diff" ${{ env.updated-specs }} \
&& exit 1
touch linted_specs.diff
spec-cleaner -d --diff-prog="git --no-pager diff" ${{ env.updated-specs }} | tee linted_specs.diff
if [ -s linted_specs.diff ]
then
echo -e "\n====================== LINTING FAILED ======================"
echo "Specs are not correctly formatted."
echo "A diff of the changes required is printed above."
echo "Linting output is available in the linted_specs artifact."
echo "Please properly format your specs according to the output before merging."
exit 1
fi
exit 0
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: linted_specs
path: linted_specs
path: linted_specs.diff
if-no-files-found: ignore