Created
February 3, 2022 17:22
-
-
Save dib258/7f3d511a8b53a7cb9fa40e3b38732d50 to your computer and use it in GitHub Desktop.
Github Action file that use php-cs-fixer to lint project on the repository
This file contains hidden or 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
name: PHP-CS-Fixer Lint | |
on: [push] | |
jobs: | |
php-linter: | |
name: PHP Linter | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Run PHP CS Fixer | |
uses: docker://oskarstark/php-cs-fixer-ga | |
with: | |
args: --config=.php-cs-fixer.dist.php --allow-risky=yes | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Fix php styling | |
branch: ${{ steps.extract_branch.outputs.branch }} | |
commit_options: '--no-verify' | |
commit_user_name: GitHub Actions Bot # defaults to "GitHub Actions" | |
commit_user_email: [email protected] # defaults to "[email protected]" | |
commit_author: GitHub Actions Bot <[email protected]> # defaults to author of the commit that triggered the run | |
# Optional. Disable dirty check and always try to create a commit and push | |
skip_dirty_check: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment