Skip to content

Commit

Permalink
Add GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnessworthy committed Mar 11, 2023
1 parent 1fee961 commit ca7baa4
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 11 deletions.
1 change: 1 addition & 0 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"vendor"
],
"files": [
"stubs/.github/workflows/ringier-code-style.yml",
".php-cs-fixer.php",
".phpcs.xml",
".styleci.yml",
Expand Down
Empty file added builds/.gitkeep
Empty file.
Binary file modified builds/ringier-code-style
Binary file not shown.
11 changes: 0 additions & 11 deletions distibutor.xml

This file was deleted.

52 changes: 52 additions & 0 deletions stubs/.github/workflows/ringier-code-style.yml
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

0 comments on commit ca7baa4

Please sign in to comment.