actions

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause

Authors: Alexander Jung <alex@nderjung.net>

Copyright (c) 2020, Alexander Jung. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-3-Clause

Authors: Alexander Jung <alex@nderjung.net>

Copyright (c) 2020, Alexander Jung. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-3-Clause

Authors: Alexander Jung <alex@nderjung.net>

Copyright (c) 2020, Alexander Jung. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-3-Clause

Authors: Alexander Jung <alex@nderjung.net>

Copyright (c) 2020, Alexander Jung. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Index

Constants

This section is empty.

Variables

View Source
var CheckCmd = &cobra.Command{
	Use:                   "check",
	Short:                 "Run the check step",
	Run:                   doCheckCmd,
	DisableFlagsInUseLine: true,
}

CheckCmd ...

View Source
var InCmd = &cobra.Command{
	Use:                   "in [OPTIONS] PATH",
	Short:                 "Run the input parsing step",
	Run:                   doInCmd,
	Args:                  cobra.ExactArgs(1),
	DisableFlagsInUseLine: true,
}

InCmd

View Source
var OutCmd = &cobra.Command{
	Use:                   "out [OPTIONS] PATH",
	Short:                 "Run the output processing step",
	Run:                   doOutCmd,
	Args:                  cobra.ExactArgs(1),
	DisableFlagsInUseLine: true,
}

OutCmd

Functions

This section is empty.

Types

type CheckRequest

type CheckRequest struct {
	Source  Source  `json:"source"`
	Version Version `json:"version"`
}

CheckRequest from the check stdin.

type CheckResponse

type CheckResponse []Version

CheckResponse represents the structure Concourse expects on stdout

func Check

func Check(req CheckRequest) (*CheckResponse, error)

type InMetadata

type InMetadata struct {
	PRID              int       `json:"pr_id"`
	PRHeadRef         string    `json:"pr_head_ref"`
	PRHeadSHA         string    `json:"pr_head_sha"`
	PRBaseRef         string    `json:"pr_base_ref"`
	PRBaseSHA         string    `json:"pr_base_sha"`
	CommentID         int64     `json:"comment_id"`
	Body              string    `json:"body"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
	AuthorAssociation string    `json:"author_association"`
	HTMLURL           string    `json:"html_url"`
	UserLogin         string    `json:"user_login"`
	UserID            int64     `json:"user_id"`
	UserAvatarURL     string    `json:"user_avatar_url"`
	UserHTMLURL       string    `json:"user_html_url"`
}

type InParams

type InParams struct {
	CommentFile     string `json:"comment_file"`
	SourcePath      string `json:"source_path"`
	GitDepth        int    `json:"git_depth"`
	Submodules      bool   `json:"submodules"`
	SkipDownload    bool   `json:"skip_download"`
	FetchTags       bool   `json:"fetch_tags"`
	IntegrationTool string `json:"integration_tool"`
}

InParams are the parameters for configuring the input

type InRequest

type InRequest struct {
	Source  Source   `json:"source"`
	Version Version  `json:"version"`
	Params  InParams `json:"params"`
}

InRequest from the check stdin.

type InResponse

type InResponse struct {
	Version  Version  `json:"version"`
	Metadata Metadata `json:"metadata"`
}

InResponse represents the structure Concourse expects on stdout

func In

func In(outputDir string, req InRequest) (*InResponse, error)

type Metadata

type Metadata []*MetadataField

Metadata contains the serialized interface

func (*Metadata) Add

func (m *Metadata) Add(name, value string)

Add a MetadataField to the Metadata struct

func (*Metadata) Get

func (m *Metadata) Get(name string) (string, error)

Get a MetadataField value from the Metadata struct

type MetadataField

type MetadataField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Metadata has a key name and value

type OutParams

type OutParams struct {
	Path              string   `json:"path"`
	State             string   `json:"state"`
	Comment           string   `json:"comment"`
	CommentFile       string   `json:"comment_file"`
	Labels            []string `json:"labels"`
	AddLabels         []string `json:"add_labels"`
	RemoveLabels      []string `json:"remove_labels"`
	DeleteLastComment bool     `json:"delete_last_comment"`
}

func (*OutParams) Validate

func (p *OutParams) Validate() error

type OutRequest

type OutRequest struct {
	Source Source    `json:"source"`
	Params OutParams `json:"params"`
}

OutRequest from the check stdin.

type OutResponse

type OutResponse struct {
	Version  Version  `json:"version"`
	Metadata Metadata `json:"metadata"`
}

OutResponse represents the structure Concourse expects on stdout

func Out

func Out(inputDir string, req OutRequest) (*OutResponse, error)

type Source

type Source struct {
	// Meta
	SkipSSLVerification bool   `json:"skip_ssl"`
	GithubEndpoint      string `json:"github_endpoint"`

	// The repository to interface with
	Repository    string `json:"repository"`
	DisableGitLfs bool   `json:"disable_git_lfs"`

	// Access methods
	AccessToken string `json:"access_token"`
	Username    string `json:"username"`
	Password    string `json:"password"`

	// Selection criteria
	OnlyMergeable        bool     `json:"only_mergeable"`
	States               []string `json:"states"`
	Labels               []string `json:"labels"`
	Comments             []string `json:"comments"`
	CommenterAssociation []string `json:"commenter_association"`
	MapCommentMeta       bool     `json:"map_comment_meta"`
	ReviewStates         []string `json:"review_states"`
	When                 string   `json:"when"` // all, latest, first

	IgnoreStates   []string `json:"ignore_states"`
	IgnoreLabels   []string `json:"ignore_labels"`
	IgnoreComments []string `json:"ignore_comments"`
	IgnoreDrafts   bool     `json:"ignore_drafts"`
}

Source parameters provided by the resource.

type Version

type Version struct {
	CreatedAt string `json:"created_at"`
	PrID      string `json:"pr_id"`
	ReviewID  string `json:"review_id"`
	CommentID string `json:"comment_id"`
}

Version communicated with Concourse.

Jump to

Keyboard shortcuts

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