actionscore

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package actionscore attempts to emulate https://github.com/actions/toolkit/blob/ac778acad245424cd37b3457ab9a9bfdf428c9cd/packages/github/src/context.ts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Payload    WebhookPayload
	EventName  string
	SHA        string
	Ref        string
	Workflow   string
	Action     string
	Actor      string
	Job        string
	RunNumber  int
	RunID      int
	APIURL     string
	ServerURL  string
	GraphQLURL string
}

Context represents the context of the Github action.

func NewContext

func NewContext() *Context

NewContext creates a new context.

func (*Context) Issue

func (c *Context) Issue() (owner, repo string, number int)

Issue returns the issue information.

func (*Context) Repo

func (c *Context) Repo() (owner, repo string)

Repo returns the repository information.

type WebhookPayload

type WebhookPayload struct {
	Repository   *github.Repository   `json:"repository,omitempty"`
	Issue        *github.Issue        `json:"issue,omitempty"`
	PR           *github.PullRequest  `json:"pull_request,omitempty"`
	Sender       *github.User         `json:"sender,omitempty"`
	Action       string               `json:"action,omitempty"`
	Installation *github.Installation `json:"installation,omitempty"`
	Comment      *github.IssueComment `json:"comment,omitempty"`
}

WebhookPayload represents the Github webhook payload.

Jump to

Keyboard shortcuts

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