Skip to content

Commit de05ae7

Browse files
authored
Harden GitHub workflows (#43)
1 parent 901668c commit de05ae7

11 files changed

Lines changed: 47 additions & 19 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ updates:
77
interval: "weekly"
88
cooldown:
99
default-days: 7
10-
groups:
11-
github-actions:
12-
patterns:
13-
- "*"
1410
ignore:
1511
- dependency-name: "yiisoft/*"
1612

@@ -21,8 +17,4 @@ updates:
2117
interval: "daily"
2218
cooldown:
2319
default-days: 7
24-
groups:
25-
composer-dependencies:
26-
patterns:
27-
- "*"
2820
versioning-strategy: increase-if-necessary

.github/workflows/bc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ on:
44

55
name: backwards compatibility
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
roave_bc_check:
912
uses: yiisoft/actions/.github/workflows/bc.yml@master
1013
with:
1114
os: >-
1215
['ubuntu-latest']
1316
php: >-
14-
['8.3']
17+
['8.4']
18+
composer-require-options: '--with-all-dependencies --ignore-platform-reqs --no-security-blocking --no-progress --ansi'

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121

2222
name: build
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
phpunit:
2629
uses: yiisoft/actions/.github/workflows/phpunit.yml@master

.github/workflows/composer-require-checker.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323

2424
name: Composer require checker
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
composer-require-checker:
2831
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master

.github/workflows/mutation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919

2020
name: mutation test
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
mutation:
2427
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master

.github/workflows/rector.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ on:
1111

1212
name: rector
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
rector:
1619
uses: yiisoft/actions/.github/workflows/rector.yml@master
17-
secrets:
18-
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
1920
with:
2021
os: >-
2122
['ubuntu-latest']

.github/workflows/static.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121

2222
name: static analysis
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
psalm:
2629
uses: yiisoft/actions/.github/workflows/psalm.yml@master

.github/workflows/zizmor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths:
9+
- '.github/**.yml'
10+
- '.github/**.yaml'
11+
pull_request:
12+
paths:
13+
- '.github/**.yml'
14+
- '.github/**.yaml'
15+
16+
permissions:
17+
actions: read # Required by zizmor when reading workflow metadata through the API.
18+
contents: read # Required to read workflow files.
19+
20+
jobs:
21+
zizmor:
22+
uses: yiisoft/actions/.github/workflows/zizmor.yml@master

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"rector/rector": "^2.5.2",
4343
"roave/infection-static-analysis-plugin": "^1.18",
4444
"spatie/phpunit-watcher": "^1.23",
45-
"vimeo/psalm": "^4.30|^5.6",
45+
"vimeo/psalm": "^4.30|^5.6|^6.0",
4646
"yiisoft/di": "^1.0",
4747
"yiisoft/test-support": "^3.0"
4848
},
@@ -73,7 +73,7 @@
7373
}
7474
},
7575
"scripts": {
76-
"test": "phpunit --testdox --no-interaction",
76+
"test": "phpunit --testdox",
7777
"test-watch": "phpunit-watcher watch"
7878
}
7979
}

phpunit.xml.dist

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
<phpunit
44
bootstrap="vendor/autoload.php"
55
colors="true"
6-
verbose="true"
76
failOnRisky="true"
87
failOnWarning="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
128
stopOnFailure="false"
139
executionOrder="random"
1410
resolveDependencies="true"
@@ -23,10 +19,10 @@
2319
</testsuite>
2420
</testsuites>
2521

26-
<coverage>
22+
<source>
2723
<include>
2824
<directory>./config</directory>
2925
<directory>./src</directory>
3026
</include>
31-
</coverage>
27+
</source>
3228
</phpunit>

0 commit comments

Comments
 (0)