-
Notifications
You must be signed in to change notification settings - Fork 15
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
0 parents
commit 94b4f43
Showing
5 changed files
with
89 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ignore all files by default | ||
* | ||
# include required files with an exception | ||
!entrypoint.sh | ||
!README.md |
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,8 @@ | ||
FROM composer:latest | ||
|
||
RUN composer global require laravel/pint --no-progress --dev | ||
ENV PATH="/tmp/vendor/bin:${PATH}" | ||
|
||
COPY "entrypoint.sh" "/entrypoint.sh" | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
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,22 @@ | ||
# GitHub Action for Laravel Pint | ||
|
||
GitHub Action implementation of the [Laravel Pint](https://github.com/laravel/pint) Package. | ||
|
||
## Usage | ||
|
||
Use with [GitHub Actions](https://github.com/features/actions) | ||
|
||
_.github/workflows/pint.yml_ | ||
|
||
``` | ||
name: PHP Linting | ||
on: pull_request | ||
jobs: | ||
phplint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: aglipanci/laravel-pint-action@main | ||
``` | ||
|
||
If provided, a `pint.json` file in the root will be used for configuration during run of the Action. |
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,30 @@ | ||
name: 'Laravel Pint' | ||
description: 'Laravel Pint is an opinionated PHP code style fixer for minimalists.' | ||
author: 'Agli Panci <agli.panci@gmail.com>' | ||
inputs: | ||
testMode: | ||
description: "would you like to run Pint on test mode" | ||
required: false | ||
|
||
verboseMode: | ||
description: "would you like to run Pint on verbose mode" | ||
required: false | ||
|
||
configPath: | ||
description: "specify the custom config path" | ||
required: false | ||
|
||
preset: | ||
description: "pint preset" | ||
required: false | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.test-mode }} | ||
- ${{ inputs.verbose-mode }} | ||
- ${{ inputs.config-path }} | ||
- ${{ inputs.preset }} | ||
branding: | ||
icon: 'eye' | ||
color: 'gray-dark' |
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,24 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
command_string=("pint") | ||
|
||
if [[ "${INPUT_TESTMODE}" ]]; then | ||
command_string+=" --test" | ||
fi | ||
|
||
if [[ "${INPUT_VERBOSEMODE}" ]]; then | ||
command_string+=" -v" | ||
fi | ||
|
||
if [[ "${INPUT_CONFIGPATH}" ]]; then | ||
command_string+=" --config ${INPUT_CONFIGPATH}" | ||
fi | ||
|
||
if [[ "${INPUT_PRESET}" ]]; then | ||
command_string+=" --preset ${INPUT_PRESET}" | ||
fi | ||
|
||
echo "Running Command: " "${command_string[@]}" | ||
|
||
${command_string[@]} |