-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fee961
commit ca7baa4
Showing
5 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: ringier-code-style | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ringier-code-style: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
tools: composer:v2 | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: Install dependencies | ||
run: composer global require ringierimu/ringier-code-style | ||
|
||
- name: Setup config files | ||
run: ringier-code-style config:dump --all --quiet | ||
|
||
- name: Get changed php files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v35 | ||
with: | ||
files: | | ||
**/*.php | ||
- name: Run step if any php file(s) changed | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
run: | | ||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | ||
ringier-code-style fix "$file" | ||
done | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Apply ringier-code-style changes |