enomotodev / php-cs-fixer-commit
创建php-cs-fixer的提交
v1.1.1
2021-10-05 07:50 UTC
Requires
- friendsofphp/php-cs-fixer: ^2.4.0 || ^3.0
README
安装
$ composer require --dev enomotodev/php-cs-fixer-commit
使用(GitHub + GitHub Actions)
创建工作流程文件
在.github/workflows
中,添加一个.yml或.yaml文件以定义你的工作流程。
例如,.github/workflows/php-cs-fixer-commit.yml
。
name: php-cs-fixer-commit on: push: jobs: php-cs-fixer-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install Dependencies run: composer install - name: php-cs-fixer-commit env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./vendor/bin/php-cs-fixer-commit <username> <email>
注意:请确保将<username>
和<email>
替换为你的用户名和电子邮件。
使用(GitHub + CircleCI)
将GitHub个人访问令牌设置为CircleCI
发送拉取请求到你的仓库需要GitHub个人访问令牌。
- 访问你的账户设置页面并生成一个具有“repo”范围的个人访问令牌。
- 在CircleCI仪表板上,转到你的应用程序的“项目设置”->“环境变量”
- 添加一个名为
GITHUB_ACCESS_TOKEN
的环境变量,并使用你的GitHub个人访问令牌进行设置
配置circle.yml
配置你的circle.yml
或.circleci/config.yml
以运行php-cs-fixer-commit
,例如
version: 2 jobs: build: # ... fixer: steps: # ... - run: name: php-cs-fixer-commit command: ./vendor/bin/php-cs-fixer-commit <username> <email>
注意:请确保将<username>
和<email>
替换为你的用户名和电子邮件。
使用(GitLab + GitLabCI)
将GitLab个人访问令牌设置为GitLabCI
发送合并请求到你的仓库需要GitLab个人访问令牌。
- 访问你的账户设置页面并生成一个具有“api”范围的个人访问令牌。
- 在GitLab仪表板上,转到你的应用程序的“设置”->“CI / CD”->“环境变量”
- 添加一个名为
GITLAB_API_PRIVATE_TOKEN
的环境变量,并使用你的GitLab个人访问令牌进行设置
配置.gitlab-ci.yml
配置你的.gitlab-ci.yml
以运行php-cs-fixer-commit
,例如
stages: # ... - fixer # ... fixer-commit: image: composer:latest stage: fixer script: - "composer install" - "$COMPOSER_HOME/vendor/bin/php-cs-fixer-commit <username> <email>"
注意:请确保将<username>
和<email>
替换为你的用户名和电子邮件。
许可
php-cs-fixer-commit是开源软件,受MIT许可许可。