Skip to content

Commit ca7baa4

Browse files
Add GitHub actions
1 parent 1fee961 commit ca7baa4

5 files changed

Lines changed: 53 additions & 11 deletions

File tree

box.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"vendor"
99
],
1010
"files": [
11+
"stubs/.github/workflows/ringier-code-style.yml",
1112
".php-cs-fixer.php",
1213
".phpcs.xml",
1314
".styleci.yml",

builds/.gitkeep

Whitespace-only changes.

builds/ringier-code-style

3.34 KB
Binary file not shown.

distibutor.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: ringier-code-style
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
ringier-code-style:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
ref: ${{ github.head_ref }}
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.1
23+
tools: composer:v2
24+
25+
- name: Get Composer Cache Directory
26+
id: composer-cache
27+
run: |
28+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
29+
30+
- name: Install dependencies
31+
run: composer global require ringierimu/ringier-code-style
32+
33+
- name: Setup config files
34+
run: ringier-code-style config:dump --all --quiet
35+
36+
- name: Get changed php files
37+
id: changed-files
38+
uses: tj-actions/changed-files@v35
39+
with:
40+
files: |
41+
**/*.php
42+
43+
- name: Run step if any php file(s) changed
44+
if: steps.changed-files.outputs.any_changed == 'true'
45+
run: |
46+
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
47+
ringier-code-style fix "$file"
48+
done
49+
50+
- uses: stefanzweifel/git-auto-commit-action@v4
51+
with:
52+
commit_message: Apply ringier-code-style changes

0 commit comments

Comments
 (0)