Expose SetJob to make EraseNeeds work (#35)

Related to #33

Reviewed-on: https://gitea.com/gitea/act/pulls/35
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Jason Song
2023-03-29 13:57:29 +08:00
parent 342ad6a51a
commit 2eb4de02ee
7 changed files with 89 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ func (w *SingleWorkflow) jobs() ([]string, []*Job, error) {
return ids, jobs, nil
}
func (w *SingleWorkflow) setJob(id string, job *Job) error {
func (w *SingleWorkflow) SetJob(id string, job *Job) error {
m := map[string]*Job{
id: job,
}
@@ -114,8 +114,9 @@ func (j *Job) Needs() []string {
return (&model.Job{RawNeeds: j.RawNeeds}).Needs()
}
func (j *Job) EraseNeeds() {
func (j *Job) EraseNeeds() *Job {
j.RawNeeds = yaml.Node{}
return j
}
func (j *Job) RunsOn() []string {