mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
Add custom enhancements
This commit is contained in:
parent
f6121d6377
commit
eabde7927b
14 changed files with 830 additions and 2 deletions
|
@ -55,6 +55,10 @@ type Config struct {
|
|||
RemoteName string // remote name in local git repo config
|
||||
ReplaceGheActionWithGithubCom []string // Use actions from GitHub Enterprise instance to GitHub
|
||||
ReplaceGheActionTokenWithGithubCom string // Token of private action repo on GitHub.
|
||||
|
||||
PresetGitHubContext *model.GithubContext // the preset github context, overrides some fields like DefaultBranch, Env, Secrets etc.
|
||||
EventJSON string // the content of JSON file to use for event.json in containers, overrides EventPath
|
||||
ContainerNamePrefix string // the prefix of container name
|
||||
}
|
||||
|
||||
// Resolves the equivalent host path inside the container
|
||||
|
@ -109,7 +113,9 @@ func New(runnerConfig *Config) (Runner, error) {
|
|||
}
|
||||
|
||||
runner.eventJSON = "{}"
|
||||
if runnerConfig.EventPath != "" {
|
||||
if runnerConfig.EventJSON != "" {
|
||||
runner.eventJSON = runnerConfig.EventJSON
|
||||
} else if runnerConfig.EventPath != "" {
|
||||
log.Debugf("Reading event.json from %s", runner.config.EventPath)
|
||||
eventJSONBytes, err := os.ReadFile(runner.config.EventPath)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue