Skip to content

Commit 7ee5acc

Browse files
committed
ci: setup autofix
1 parent 8e8d0d5 commit 7ee5acc

3 files changed

Lines changed: 40 additions & 25 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
name: Autoformat
1+
name: autofix.ci # needed to securely identify the workflow by the action
22

33
on:
4+
pull_request:
45
push:
6+
branches:
7+
- master
58

69
jobs:
710
composer-normalize:
811
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
914
steps:
1015
- uses: actions/checkout@v4
11-
with:
12-
ref: ${{ github.head_ref }}
1316

1417
- uses: shivammathur/setup-php@v2
1518
with:
@@ -21,17 +24,16 @@ jobs:
2124

2225
- run: composer normalize
2326

24-
- uses: stefanzweifel/git-auto-commit-action@v5
27+
- uses: autofix-ci/action@v1
2528
with:
26-
commit_message: Normalize composer.json
29+
commit-message: Apply composer normalize changes
2730

2831
docs:
2932
runs-on: ubuntu-latest
33+
permissions:
34+
contents: read
3035
steps:
3136
- uses: actions/checkout@v4
32-
with:
33-
ref: ${{ github.head_ref }}
34-
token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }}
3537

3638
- uses: shivammathur/setup-php@v2
3739
with:
@@ -43,23 +45,25 @@ jobs:
4345

4446
- run: composer docs
4547

48+
- run: npx prettier --write --tab-width=2 *.md **/*.md
49+
4650
- uses: creyD/prettier_action@v4.3
4751
with:
52+
dry: "true"
4853
prettier_options: --write --tab-width=2 *.md **/*.md
4954
commit_message: Prettify docs
5055

56+
- uses: autofix-ci/action@v1
57+
if: always()
58+
with:
59+
commit-message: Prettify docs
60+
5161
php-cs-fixer:
5262
runs-on: ubuntu-latest
53-
5463
permissions:
55-
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
56-
contents: write
57-
64+
contents: read
5865
steps:
5966
- uses: actions/checkout@v4
60-
with:
61-
ref: ${{ github.head_ref }}
62-
token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }}
6367

6468
- uses: shivammathur/setup-php@v2
6569
with:
@@ -71,6 +75,6 @@ jobs:
7175

7276
- run: vendor/bin/php-cs-fixer fix
7377

74-
- uses: stefanzweifel/git-auto-commit-action@v5
78+
- uses: autofix-ci/action@v1
7579
with:
76-
commit_message: Apply php-cs-fixer changes
80+
commit-message: Apply php-cs-fixer changes

CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
77

8+
9+
10+
11+
break docs
812
You can find and compare releases at the [GitHub release page](https://github.com/webonyx/graphql-php/releases).
913

1014
## Unreleased
@@ -19,7 +23,8 @@ You can find and compare releases at the [GitHub release page](https://github.co
1923

2024
### Fixed
2125

22-
- Handle fields that return lists in `ResolveInfo::getFieldSelectionWithAliases` https://github.com/webonyx/graphql-php/pull/1664
26+
- Handle fields that return lists in `ResolveInfo::getFieldSelectionWithAliases` https://github.com/webonyx/graphql-php/pull/1664
27+
2328

2429
## v15.19.0
2530

@@ -63,7 +68,7 @@ You can find and compare releases at the [GitHub release page](https://github.co
6368

6469
- Add field config decorator when building schema from SDL https://github.com/webonyx/graphql-php/pull/1590
6570

66-
## v15.14.3
71+
## v15.14.3
6772

6873
### Fixed
6974

src/Server/ServerConfig.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ class ServerConfig
4747
*
4848
* @throws InvariantViolation
4949
*/
50-
public static function create(array $config = []): self
50+
public static function create(
51+
array $config = []): self
5152
{
5253
$instance = new static();
5354
foreach ($config as $key => $value) {
54-
switch ($key) {
55+
switch ($key ) {
5556
case 'schema':
57+
58+
5659
$instance->setSchema($value);
5760
break;
5861
case 'rootValue':
@@ -62,13 +65,16 @@ public static function create(array $config = []): self
6265
$instance->setContext($value);
6366
break;
6467
case 'fieldResolver':
65-
$instance->setFieldResolver($value);
68+
$instance->setFieldResolver($value
69+
);
6670
break;
6771
case 'validationRules':
6872
$instance->setValidationRules($value);
6973
break;
7074
case 'queryBatching':
71-
$instance->setQueryBatching($value);
75+
76+
$instance->setQueryBatching(
77+
$value);
7278
break;
7379
case 'debugFlag':
7480
$instance->setDebugFlag($value);

0 commit comments

Comments
 (0)