Fix the PR comments github actions. No longer comments on ALL PRs

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2021-11-19 06:59:19 +00:00 committed by Gareth J. Greenaway
parent 08ac1a8613
commit fadb1d3b5c

View file

@ -23,6 +23,10 @@ jobs:
python -m pip install --upgrade pip
pip install pre-commit pygithub
- name: Install Pre-Commit Hooks
run: |
pre-commit install --install-hooks
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
@ -38,11 +42,14 @@ jobs:
id: check-known-missing-docstrings
if: github.event_name == 'pull_request_target' && steps.changed-files.outputs.salt == 'true'
continue-on-error: true
shell: bash
run: |
set -o pipefail
pre-commit run -v --hook-stage manual check-known-missing-docstrings --show-diff-on-failure --color=never --files ${{ join(fromJSON(steps.changed-files.outputs.salt_files), ' ') }} | tee output.txt
- name: Comment on PR
if: hashFiles('output.txt') != ''
# Comment on PRs if pre-commit triggered a failure
if: steps.check-known-missing-docstrings.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |