cmd

package
v0.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2020 Flanksource This file is part of Flanksource build tools

Copyright © 2020 Flanksource This file is part of Flanksource build tools

Index

Constants

This section is empty.

Variables

View Source
var ActionReport = &cobra.Command{
	Use:   "report-junit",
	Short: "Update a check result with annotations",
	Args:  cobra.MinimumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		results, err := junit.ParseJunitResultFiles(args...)
		if err != nil {
			return err
		}
		run, err := client.GetActionRun()
		if err != nil {
			return err
		}
		return run.Annotate(*results)
	},
}
View Source
var Actions = &cobra.Command{
	Use: "actions",
}
View Source
var Github = &cobra.Command{
	Use:     "gh",
	Aliases: []string{"github"},
	Short:   "github related actions",
}
View Source
var Junit = &cobra.Command{
	Use: "junit",
}
View Source
var PullRequestComment = &cobra.Command{
	Use:   "comment",
	Short: "Posts a comment to a PR",
	Args:  cobra.MinimumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		return client.Comment(args[0])
	},
}
View Source
var PullRequestReport = &cobra.Command{
	Use:   "report-junit",
	Short: "Posts a comment detailing JUnit test results to a PR",
	Args:  cobra.MinimumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		results, err := junit.ParseJunitResultFiles(args...)
		if err != nil {
			return err
		}

		md := results.GenerateMarkdown()

		if failureMessage != "" && !results.Success() {
			md = failureMessage + "\n" + md
		}
		if successMessage != "" && results.Success() {
			md = successMessage + "\n" + md
		}
		md += results.GenerateMarkdown()

		if md != "" {
			return client.Comment(md)
		}
		return nil
	},
}
View Source
var PullRequests = &cobra.Command{
	Use:     "pull-requests",
	Aliases: []string{"pr"},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL