LoginSignup
4
1

More than 3 years have passed since last update.

GitHubActionsでPHPInsightsの自動コメント投稿する

Last updated at Posted at 2020-12-23

こんにちは。M2です。
GitHub Actions Advent Calendar 2020の22日目を隙間埋めで担当させていただきます。

概要

公式まんまですが、reviewdogなど使おうとして遠回りしたので備忘録がてらに。

対応方法

#.github/workflows/pr.yml
name: CI
on:
    - pull_request
jobs:
    phpinsights:
        runs-on: ubuntu-latest
        name: PHP Insights checks
        steps:
            - uses: actions/checkout@v2
            - uses: shivammathur/setup-php@v1
              with:
                  php-version: 7.3
            - run: composer install --prefer-dist --no-progress --no-suggest
            - run: vendor/bin/phpinsights -n --ansi --format=github-action # format=github-actionをつける

すると自動コメント投稿が

Image from Gyazo

参考

PHP Insights公式ドキュメント

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1