You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ke...@apache.org on 2022/05/10 07:05:16 UTC

[skywalking-eyes] branch gha-summary created (now 8b387c0)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch gha-summary
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git


      at 8b387c0  Add GitHub Action step summary for better experience

This branch includes the following new commits:

     new 8b387c0  Add GitHub Action step summary for better experience

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking-eyes] 01/01: Add GitHub Action step summary for better experience

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch gha-summary
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git

commit 8b387c097f7389608ef8e5f9d2cef770962a0605
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Tue May 10 15:05:02 2022 +0800

    Add GitHub Action step summary for better experience
---
 commands/header_check.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/commands/header_check.go b/commands/header_check.go
index e0ec2e1..aee7db4 100644
--- a/commands/header_check.go
+++ b/commands/header_check.go
@@ -18,6 +18,8 @@
 package commands
 
 import (
+	"os"
+
 	"github.com/apache/skywalking-eyes/internal/logger"
 	"github.com/apache/skywalking-eyes/pkg/header"
 	"github.com/apache/skywalking-eyes/pkg/review"
@@ -43,6 +45,13 @@ var CheckCommand = &cobra.Command{
 
 		logger.Log.Infoln(result.String())
 
+		if summaryFileName := os.Getenv("GITHUB_STEP_SUMMARY"); summaryFileName != "" {
+			if summaryFile, err := os.OpenFile(summaryFileName, os.O_WRONLY|os.O_APPEND, 0644); err == nil {
+				defer summaryFile.Close()
+				summaryFile.WriteString(result.String())
+			}
+		}
+
 		if result.HasFailure() {
 			if err := review.Header(&result, &Config); err != nil {
 				logger.Log.Warnln("Failed to create review comments", err)