Merge pull request #1398 from nextcloud/fix/pull-request-action

Update workflows to handle pull requests correctly
This commit is contained in:
Christian Wolf 2022-12-28 14:15:13 +01:00 коммит произвёл GitHub
Родитель e8d4be4934 587194026b
Коммит babb28a03f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 12 добавлений и 4 удалений

16
.github/workflows/pull-checks.yml поставляемый
Просмотреть файл

@ -29,15 +29,23 @@ jobs:
lines="$(git diff HEAD~1 --name-only)"
echo "Changed files:"
echo "$lines"
cnt="$(echo "$lines" | grep -v '^package-lock.json$' | wc -l)"
echo "That are $cnt changed files."
totalcnt="$(echo "$lines" | wc -l)"
echo "totalcount=$totalcnt" >> $GITHUB_OUTPUT
#
cnt="$(echo "$lines" | grep -v '^package-lock.json$' | grep -v '^\.github/workflows/' | wc -l)"
echo "num=$cnt" >> $GITHUB_OUTPUT
#
echo "That are $totalcnt changed files. After reducing the number there are $cnt files left."
- name: Error if the number of diff lines is zero
- name: Error/warn if the number of diff lines is zero
run: |
if [ ${{ steps.file-names.outputs.num }} -gt 0 ]; then
echo "::error file=CHANGELOG.md::There was no change in the changelog detected. Please fill in a valid entry into that file."
exit 1
if: ${{ steps.diff.outputs.lines == 0 && steps.file-names.outputs.num > 0 }}
else
echo "::warning file=CHANGELOG.md::There was no change in the changelog detected. There are in total ${{ steps.file-names.outputs.totalcount }} changed files."
fi
if: ${{ steps.diff.outputs.lines == 0 }}
todo-checker:
name: Check for added todo messages