Skip to content

Commit 7dc0423

Browse files
committed
chore: update CI workflow to conditionally run steps for pull request targets
1 parent d6a65a0 commit 7dc0423

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,28 @@ jobs:
4747
run: pipenv run pytest --cov --cov-report=lcov:coverage.lcov
4848

4949
- name: Coverage Badge
50+
if: ${{ github.event_name == 'pull_request_target' }}
5051
uses: ImBIOS/lcov-coverage-badge@v1
5152
with:
5253
file: ./coverage.lcov
5354

5455
- name: Verify Changed files
56+
if: ${{ github.event_name == 'pull_request_target' }}
5557
uses: tj-actions/verify-changed-files@v20
5658
id: verify-changed-files
5759
with:
5860
files: "coverage.svg"
5961

6062
- name: Commit files
61-
if: steps.verify-changed-files.outputs.files_changed == 'true'
63+
if: ${{ github.event_name == 'pull_request_target' && steps.verify-changed-files.outputs.files_changed == 'true' }}
6264
run: |
6365
git config --local user.email "github-actions[bot]@users.noreply.github.com"
6466
git config --local user.name "github-actions[bot]"
6567
git add coverage.svg
6668
git commit -m "Updated coverage.svg"
6769
6870
- name: Push changes
69-
if: steps.verify-changed-files.outputs.files_changed == 'true'
71+
if: ${{ github.event_name == 'pull_request_target' && steps.verify-changed-files.outputs.files_changed == 'true' }}
7072
uses: ad-m/github-push-action@master
7173
with:
7274
github_token: ${{ secrets.github_token }}

0 commit comments

Comments
 (0)