Skip to content

Commit 3eba22c

Browse files
ci: run tests and phpstan on pull requests
Both workflows only triggered on push, so a pull request from a fork ran no tests and no static analysis at all: the checks appeared on the branch after a merge, which is the wrong side of the decision. That matters more than usual here because dependabot-auto-merge.yml runs on pull_request_target and calls `gh pr merge --auto` for every semver minor and patch bump, so dependency updates could reach main without a single test having run against them. Push is now scoped to main, so a branch that has a pull request open gets one run rather than two.
1 parent 2c37af3 commit 3eba22c

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/phpstan.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: PHPStan
22

33
on:
44
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.php'
9+
- 'phpstan.neon.dist'
10+
- '.github/workflows/phpstan.yml'
11+
pull_request:
512
paths:
613
- '**.php'
714
- 'phpstan.neon.dist'

.github/workflows/run-tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ name: run-tests
22

33
on:
44
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.php'
9+
- '.github/workflows/run-tests.yml'
10+
- 'phpunit.xml.dist'
11+
- 'composer.json'
12+
- 'composer.lock'
13+
pull_request:
514
paths:
615
- '**.php'
716
- '.github/workflows/run-tests.yml'

0 commit comments

Comments
 (0)