Last active
September 29, 2021 08:29
-
-
Save stefanzweifel/3fb634b64dd58b8f66015483e1930f5e to your computer and use it in GitHub Desktop.
GitHub Actions Workflows to run prettier and php-cs-fixer automatically
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: Format PHP | |
on: | |
pull_request: | |
paths: | |
- '*.php' | |
jobs: | |
php-cs-fixer: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install | |
run: composer install | |
- name: Run php-cs-fixer | |
run: ./vendor/bin/php-cs-fixer fix | |
- uses: stefanzweifel/[email protected] | |
with: | |
commit_message: Apply php-cs-fixer changes | |
branch: ${{ github.head_ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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: Format Prettier | |
on: | |
pull_request: | |
paths: | |
- '*.css' | |
- '*.js' | |
- '*.vue' | |
jobs: | |
prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install | |
run: yarn install | |
env: | |
CI: true | |
- name: Run prettier | |
run: yarn run prettier --write 'source/_assets/**/*.{scss,css,js,vue}' 'source/**/*.md' | |
- uses: stefanzweifel/[email protected] | |
with: | |
commit_message: Apply prettier changes | |
branch: ${{ github.head_ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment