Skip to content

Commit

Permalink
Revert "Remove else statements from if/return blocks."
Browse files Browse the repository at this point in the history
This reverts commit d28ad0e.
  • Loading branch information
stephenwithav committed Oct 30, 2024
1 parent 644b16e commit b1e6d3b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
32 changes: 16 additions & 16 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,30 +856,30 @@ func (rc *RunContext) getStepsContext() map[string]*model.StepResult {
func (rc *RunContext) getGithubContext(ctx context.Context) *model.GithubContext {
logger := common.Logger(ctx)
ghc := &model.GithubContext{
Action: rc.CurrentStep,
ActionPath: rc.ActionPath,
ActionRef: rc.Env["GITHUB_ACTION_REF"],
ActionRepository: rc.Env["GITHUB_ACTION_REPOSITORY"],
Actor: rc.Config.Actor,
BaseRef: rc.Config.Env["GITHUB_BASE_REF"],
Event: make(map[string]interface{}),
Workflow: rc.Run.Workflow.Name,
RunAttempt: rc.Config.Env["GITHUB_RUN_ATTEMPT"],
RunID: rc.Config.Env["GITHUB_RUN_ID"],
RunNumber: rc.Config.Env["GITHUB_RUN_NUMBER"],
Actor: rc.Config.Actor,
EventName: rc.Config.EventName,
HeadRef: rc.Config.Env["GITHUB_HEAD_REF"],
Action: rc.CurrentStep,
Token: rc.Config.Token,
Job: rc.Run.JobID,
Ref: rc.Config.Env["GITHUB_REF"],
RefName: rc.Config.Env["GITHUB_REF_NAME"],
RefType: rc.Config.Env["GITHUB_REF_TYPE"],
Repository: rc.Config.Env["GITHUB_REPOSITORY"],
ActionPath: rc.ActionPath,
ActionRepository: rc.Env["GITHUB_ACTION_REPOSITORY"],
ActionRef: rc.Env["GITHUB_ACTION_REF"],
RepositoryOwner: rc.Config.Env["GITHUB_REPOSITORY_OWNER"],
RetentionDays: rc.Config.Env["GITHUB_RETENTION_DAYS"],
RunAttempt: rc.Config.Env["GITHUB_RUN_ATTEMPT"],
RunID: rc.Config.Env["GITHUB_RUN_ID"],
RunNumber: rc.Config.Env["GITHUB_RUN_NUMBER"],
RunnerPerflog: rc.Config.Env["RUNNER_PERFLOG"],
RunnerTrackingID: rc.Config.Env["RUNNER_TRACKING_ID"],
Repository: rc.Config.Env["GITHUB_REPOSITORY"],
Ref: rc.Config.Env["GITHUB_REF"],
Sha: rc.Config.Env["SHA_REF"],
Token: rc.Config.Token,
Workflow: rc.Run.Workflow.Name,
RefName: rc.Config.Env["GITHUB_REF_NAME"],
RefType: rc.Config.Env["GITHUB_REF_TYPE"],
BaseRef: rc.Config.Env["GITHUB_BASE_REF"],
HeadRef: rc.Config.Env["GITHUB_HEAD_REF"],
Workspace: rc.Config.Env["GITHUB_WORKSPACE"],
}
if rc.JobContainer != nil {
Expand Down
56 changes: 28 additions & 28 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,47 @@ type Runner interface {

// Config contains the config for a new runner
type Config struct {
ActionCache ActionCache // Use a custom ActionCache Implementation
Actor string // the user that triggered the event
Workdir string // path to working directory
ActionCacheDir string // path used for caching action contents
ActionOfflineMode bool // when offline, use caching action contents
Actor string // the user that triggered the event
ArtifactServerAddr string // the address the artifact server binds to
ArtifactServerPath string // the path where the artifact server stores uploads
ArtifactServerPort string // the port the artifact server binds to
AutoRemove bool // controls if the container is automatically removed upon workflow completion
BindWorkdir bool // bind the workdir to the job container
ContainerArchitecture string // Desired OS/architecture platform for running containers
ContainerCapAdd []string // list of kernel capabilities to add to the containers
ContainerCapDrop []string // list of kernel capabilities to remove from the containers
ContainerDaemonSocket string // Path to Docker daemon socket
ContainerNetworkMode docker_container.NetworkMode // the network mode of job containers (the value of --network)
ContainerOptions string // Options for the job container
DefaultBranch string // name of the main branch for this repository
Env map[string]string // env for containers
EventName string // name of event to run
EventPath string // path to JSON file to use for event.json in containers
DefaultBranch string // name of the main branch for this repository
ReuseContainers bool // reuse containers to maintain state
ForcePull bool // force pulling of the image, even if already present
ForceRebuild bool // force rebuilding local docker image action
GitHubInstance string // GitHub instance to use, default "github.com"
Inputs map[string]string // manually passed action inputs
InsecureSecrets bool // switch hiding output when printing to terminal
JSONLogger bool // use json or text logger
LogOutput bool // log the output from docker run
JSONLogger bool // use json or text logger
LogPrefixJobID bool // switches from the full job name to the job id
Matrix map[string]map[string]bool // Matrix config to run
NoSkipCheckout bool // do not skip actions/checkout
Env map[string]string // env for containers
Inputs map[string]string // manually passed action inputs
Secrets map[string]string // list of secrets
Vars map[string]string // list of vars
Token string // GitHub token
InsecureSecrets bool // switch hiding output when printing to terminal
Platforms map[string]string // list of platforms
Privileged bool // use privileged mode
UsernsMode string // user namespace to use
ContainerArchitecture string // Desired OS/architecture platform for running containers
ContainerDaemonSocket string // Path to Docker daemon socket
ContainerOptions string // Options for the job container
UseGitIgnore bool // controls if paths in .gitignore should not be copied into container, default true
GitHubInstance string // GitHub instance to use, default "github.com"
ContainerCapAdd []string // list of kernel capabilities to add to the containers
ContainerCapDrop []string // list of kernel capabilities to remove from the containers
AutoRemove bool // controls if the container is automatically removed upon workflow completion
ArtifactServerPath string // the path where the artifact server stores uploads
ArtifactServerAddr string // the address the artifact server binds to
ArtifactServerPort string // the port the artifact server binds to
NoSkipCheckout bool // do not skip actions/checkout
RemoteName string // remote name in local git repo config
ReplaceGheActionTokenWithGithubCom string // Token of private action repo on GitHub.
ReplaceGheActionWithGithubCom []string // Use actions from GitHub Enterprise instance to GitHub
ReuseContainers bool // reuse containers to maintain state
Secrets map[string]string // list of secrets
Token string // GitHub token
UseGitIgnore bool // controls if paths in .gitignore should not be copied into container, default true
UsernsMode string // user namespace to use
Vars map[string]string // list of vars
Workdir string // path to working directory
ReplaceGheActionTokenWithGithubCom string // Token of private action repo on GitHub.
Matrix map[string]map[string]bool // Matrix config to run
ContainerNetworkMode docker_container.NetworkMode // the network mode of job containers (the value of --network)
ActionCache ActionCache // Use a custom ActionCache Implementation
}

type caller struct {
Expand Down

0 comments on commit b1e6d3b

Please sign in to comment.