0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[GitHub Actions] 小技:ErrorやWarning logに色をつけて強調しよう

0
Posted at

前提

この記事ではGitHub Actionsのエラーログやワーニングログに色をつけて強調する方法を紹介します。

皆さんは既に知っているかもしれませんが、私はレビューで指摘を受けて初めて知りました。。

他にも色々面白そうなログコマンドがあるようなので見てみてください。
公式ドキュメント

方法

こんな感じで、::error::や::warning::といったログコマンドをメッセージの先頭に置くと...

name: Decorate the logs
on:
  push:
    branches:
      - main

jobs:
  show-decorated-log:
    runs-on: ubuntu-latest
    steps:
      - name: show decorated log
        run: |
          echo "::error::This is an error message"

          echo "::warning::This is a warning message"

          echo "::notice::This is an info message"

ログに色をつけることができて、かなり見やすくなるし
image.png

サマリにも出力されるので、エラーに気づくやすくなります。
image.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?