├── src └── .hidden ├── .gitignore ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug_report.yml ├── workflows │ ├── code_review.yml │ └── health_score.yml ├── PULL_REQUEST_TEMPLATE.md ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md ├── CHANGELOG.md ├── LICENSE ├── SECURITY.md ├── action.yml └── README.md /src/.hidden: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /.github/workflows/code_review.yml: -------------------------------------------------------------------------------- 1 | name: Fix code styles 2 | on: [pull_request] 3 | jobs: 4 | build: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v2 8 | 9 | - name: PHP Code Style 10 | uses: ale94lko/php-cs-fixer-action@v1.0.1 11 | with: 12 | php-cs-fixer-version: v3.9.4 13 | rules-version: v1.0.1 14 | use-full-rules: false -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG for PHP CS Fixer Action 2 | ========================== 3 | 4 | This file contains changelogs for stable releases only. 5 | 6 | Changelog for v1.0.1 7 | -------------------- 8 | 9 | * feature: Add a template for bug reporting issues for better understanding of the error. [#8](https://github.com/ale94lko/php-cs-fixer-action/issues/8) 10 | * feature: Update documentation 11 | 12 | Changelog for v1.0.0 13 | -------------------- 14 | 15 | * First stable release. -------------------------------------------------------------------------------- /.github/workflows/health_score.yml: -------------------------------------------------------------------------------- 1 | name: Repo Health Score Badge 2 | on: 3 | schedule: # execute every day at 02:00 4 | - cron: "0 2 * * *" 5 | workflow_dispatch: 6 | jobs: 7 | build: 8 | name: Job to deploy badge 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | with: 13 | repository: ale94lko/repo-health-score 14 | 15 | - name: Get Repo Health Score Badge 16 | uses: ale94lko/repo-health-score@main 17 | 18 | - name: Deploy badge 19 | uses: crazy-max/ghaction-github-pages@v3 20 | with: 21 | target_branch: output 22 | build_dir: dist 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Fidel Alejandro Fernández Arias 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 4 | 5 | Fixes # (issue) 6 | 7 | ## Type of change 8 | 9 | Please delete options that are not relevant. 10 | 11 | - [ ] Bug fix (non-breaking change which fixes an issue) 12 | - [ ] New feature (non-breaking change which adds functionality) 13 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 14 | - [ ] This change requires a documentation update 15 | 16 | # How Has This Been Tested? 17 | 18 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration 19 | 20 | - [ ] Test A 21 | - [ ] Test B 22 | 23 | # Checklist: 24 | 25 | - [ ] My code follows the style guidelines of this project 26 | - [ ] I have performed a self-review of my own code 27 | - [ ] I have commented my code, particularly in hard-to-understand areas 28 | - [ ] I have made corresponding changes to the documentation 29 | - [ ] My changes generate no new warnings 30 | - [ ] I have added tests that prove my fix is effective or that my feature works 31 | - [ ] New and existing unit tests pass locally with my changes 32 | - [ ] Any dependent changes have been merged and published in downstream modules 33 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Security 2 | 3 | I take the security of my software products and services seriously, which 4 | includes all source code repositories managed through GitHub. 5 | 6 | If you believe you have found a security vulnerability in any repository, please 7 | report it to me as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to me by sending an email to 14 | [ale94lko@gmail.com](mailto:ale94lko@gmail.com). 15 | 16 | Please include the requested information listed below (as much as you can 17 | provide) to help me better understand the nature and scope of the possible 18 | issue: 19 | 20 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 21 | * Full paths of source file(s) related to the manifestation of the issue 22 | * The location of the affected source code (tag/branch/commit or direct URL) 23 | * Any special configuration required to reproduce the issue 24 | * Step-by-step instructions to reproduce the issue 25 | * Proof-of-concept or exploit code (if possible) 26 | * Impact of the issue, including how an attacker might exploit the issue 27 | 28 | This information will help me triage your report more quickly. 29 | 30 | ## Preferred Languages 31 | 32 | We prefer all communications to be in English or Spanish. 33 | 34 | ## Policy 35 | 36 | We follow the principle of [Coordinated Vulnerability Disclosure](https://www.iso.org/standard/72311.html). 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest an idea for this project 3 | title: "Feature: " 4 | labels: ['type: New Feature'] 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this new feature report! 11 | 12 | Before you begin, **please ensure that there are no [existing issues](https://github.com/ale94lko/php-cs-fixer-action/issues), whether still open or closed, related to your report**. 13 | If there is, your report will be closed promptly. 14 | --- 15 | 16 | - type: checkboxes 17 | id: terms 18 | attributes: 19 | label: Code of Conduct 20 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ale94lko/php-cs-fixer-action/blob/main/.github/CODE_OF_CONDUCT.md) 21 | options: 22 | - label: I agree to follow this project's Code of Conduct 23 | required: true 24 | 25 | - type: input 26 | id: contact 27 | attributes: 28 | label: Contact Details 29 | description: How can we get in touch with you if we need more info? 30 | placeholder: eg. email@example.com 31 | validations: 32 | required: false 33 | 34 | - type: textarea 35 | attributes: 36 | label: What do you have in mind to make this project better? 37 | description: | 38 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 39 | validations: 40 | required: false -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'ale94lko php-cs-fixer-action' 2 | description: 'Action to fix PHP Code Standards' 3 | author: 'Fidel Alejandro Fernandez Arias' 4 | branding: 5 | icon: 'check-circle' 6 | color: 'green' 7 | inputs: 8 | php-cs-fixer-version: 9 | description: 'Version of php-cs-fixer to download' 10 | required: false 11 | default: 'v3.9.4' 12 | rules-version: 13 | description: 'Version of rules to check' 14 | required: false 15 | default: 'v1.0.1' 16 | use-full-rules: 17 | description: 'Whether to use the full rules package or the minimal one' 18 | required: false 19 | default: 'true' 20 | outputs: 21 | code-style-result: 22 | description: 'Report generated by php-cs-fixer' 23 | value: ${{ steps.php-cs-fixer.outputs.result }} 24 | runs: 25 | using: 'composite' 26 | steps: 27 | - name: Download php-cs-fixer 28 | shell: bash 29 | run: | 30 | curl --fail -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/${{ inputs.php-cs-fixer-version }}/php-cs-fixer.phar -o php-cs-fixer 31 | chmod a+x php-cs-fixer 32 | 33 | - name: Download PHP CS Fixer rules full 34 | if: inputs.use-full-rules == 'true' 35 | shell: bash 36 | run: curl --fail -L https://github.com/ale94lko/php-cs-fixer-rules/releases/download/${{ inputs.rules-version }}/default.php-cs-fixer.dist.php -o .php-cs-fixer.dist.php 37 | 38 | - name: Download PHP CS Fixer rules minimal 39 | if: inputs.use-full-rules == 'false' 40 | shell: bash 41 | run: curl --fail -L https://github.com/ale94lko/php-cs-fixer-rules/releases/download/${{ inputs.rules-version }}/default.php-cs-fixer.dist.min.php -o .php-cs-fixer.dist.php 42 | 43 | - name: Run PHP CS Fixer 44 | id: php-cs-fixer 45 | shell: bash 46 | run: | 47 | ./php-cs-fixer fix --verbose --allow-risky=yes --dry-run --format=txt > ./result.txt 48 | echo "::set-output name=result::$(cat ./result.txt)" -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Create a report to help us improve 3 | title: "Bug: " 4 | labels: ['type: Bug'] 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this bug report! 11 | 12 | Before you begin, **please ensure that there are no [existing issues](https://github.com/ale94lko/php-cs-fixer-action/issues), whether still open or closed, related to your report**. 13 | If there is, your report will be closed promptly. 14 | --- 15 | 16 | - type: input 17 | id: php-cs-fixer-version 18 | attributes: 19 | label: php-cs-fixer version 20 | description: | 21 | e.g. v3.9.4 22 | If you are not using the [latest version](https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases), please 23 | check to see if the problem occurs with the latest version. 24 | validations: 25 | required: true 26 | 27 | - type: dropdown 28 | id: rules-version 29 | attributes: 30 | label: Rules version 31 | description: Which php-cs-fixer-rules version did you run your code? 32 | multiple: true 33 | options: 34 | - 'Default' 35 | - 'v1.0' 36 | - 'v1.0.1' 37 | validations: 38 | required: true 39 | 40 | - type: dropdown 41 | id: full-rules-version 42 | attributes: 43 | label: Full or minimal rules version 44 | description: Which rules package did you run your code? 45 | multiple: true 46 | options: 47 | - 'Default' 48 | - 'Full rules package' 49 | - 'Minimal rules package' 50 | validations: 51 | required: true 52 | 53 | - type: textarea 54 | id: description 55 | attributes: 56 | label: What happened? 57 | placeholder: Tell us what you see! 58 | validations: 59 | required: true 60 | 61 | - type: textarea 62 | attributes: 63 | label: Steps to Reproduce 64 | description: Steps to reproduce the behavior. 65 | validations: 66 | required: true 67 | 68 | - type: textarea 69 | attributes: 70 | label: Expected Output 71 | description: What do you expect to happen instead of this bug? 72 | validations: 73 | required: true 74 | 75 | - type: textarea 76 | attributes: 77 | label: Anything else? 78 | description: | 79 | Links? References? Anything that will give us more context about the issue you are encountering! 80 | 81 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 82 | validations: 83 | required: false -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |