@@ -162,136 +162,7 @@ codestyle dependabot --help
162162codestyle editorconfig --help
163163```
164164
165- ### GitHub Action
166-
167- > ATTENTION
168- >
169- > Starting with code styler version 4.2.0, we will no longer support
170- > a [ container] ( https://github.com/marketplace/actions/the-dragon-code-styler ) for GitHub Actions.
171- >
172- > Instead, use direct dependency installation using the examples below.
173-
174- Create a new ` .github/workflows/code-style.yml ` file and add the content to it:
175-
176- ``` yaml
177- name : Code Style
178-
179- on : [ push, pull_request ]
180-
181- permissions : write-all
182-
183- jobs :
184- check :
185- runs-on : ubuntu-latest
186-
187- if : ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }}
188-
189- steps :
190- - name : Checkout code
191- uses : actions/checkout@v4
192-
193- - name : Setup PHP
194- uses : shivammathur/setup-php@v2
195- with :
196- extensions : curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
197- coverage : none
198-
199- - name : Install dependency
200- run : composer global require dragon-code/codestyler
201-
202- - name : Check the code-style
203- run : codestyle --test
204-
205- fix :
206- runs-on : ubuntu-latest
207-
208- if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
209-
210- steps :
211- - name : Checkout code
212- uses : actions/checkout@v4
213-
214- - name : Setup PHP
215- uses : shivammathur/setup-php@v2
216- with :
217- extensions : curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
218- coverage : none
219-
220- - name : Setup Composer
221- run : |
222- composer global config --no-plugins allow-plugins.dragon-code/codestyler true
223- composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
224-
225- composer config --no-plugins allow-plugins.dragon-code/codestyler true
226- composer config --no-plugins allow-plugins.ergebnis/composer-normalize true
227-
228- - name : Install dependencies
229- run : |
230- composer global require dragon-code/codestyler
231- composer global require ergebnis/composer-normalize
232-
233- - name : Fix the code-style
234- run : |
235- # Copies the `.editorconfig` file to the folder from which the command is run.
236- # The file contains a complete set of instructions for the IDE that supports EditorConfig.
237- codestyle editorconfig
238-
239- # Copies the `The_Dragon_Code_phpStorm.xml` file to the folder from which the command is run.
240- # The file contains a complete set of instructions for JetBrains PhpStorm.
241- codestyle phpstorm
242-
243- # Creates or updates the `dependabot.yml` file for GitHub Actions.
244- codestyle dependabot
245-
246- # The main script for fixing the project code style
247- codestyle
248-
249- # Provides a composer plugin for normalizing `composer.json`.
250- composer normalize
251-
252- - name : Create a Pull Request
253- uses : peter-evans/create-pull-request@v6
254- with :
255- branch : code-style
256- branch-suffix : random
257- delete-branch : true
258- title : " 🦋 The code style has been fixed"
259- commit-message : 🦋 The code style has been fixed
260- body : The code style has been fixed
261- labels : code-style
262- ` ` `
263-
264- You can also use a simplified version of the configuration by linking to our settings.
265-
266- In this case, the following settings will be applied:
267-
268- - Always checks if the event is not equal to ` push` or the branch is not equal to `main`
269- - Correcting the code style will take the following steps :
270- - Will add the following plugins to the list
271- of [allowed plugins](https://getcomposer.org/doc/06-config.md#allow-plugins)
272- in your `composer.json` file :
273- - ` dragon-code/codestyler`
274- - ` ergebnis/composer-normalize`
275- - Updates the `.github/dependabot.yml` file
276- - Updates the `.editorconfig` file
277- - Will correct the order of elements in the `composer.json` file to match
278- the [official schema](https://github.com/composer/composer/blob/main/res/composer-schema.json).
279- - Corrects the code style of your project.
280-
281- ` ` ` yml
282- name: Code Style
283-
284- on: [ push, pull_request ]
285-
286- permissions: write-all
287-
288- jobs:
289- style:
290- name: Code Style
291- uses: TheDragonCode/.github/.github/workflows/code-style.yml@main
292- ` ` `
293-
294- # ## Other CI/CD
165+ ### CI/CD
295166
296167``` bash
297168composer global require dragon-code/codestyler
0 commit comments