diff --git a/pkg/jobparser/jobparser.go b/pkg/jobparser/jobparser.go index 33b900d..4165b46 100644 --- a/pkg/jobparser/jobparser.go +++ b/pkg/jobparser/jobparser.go @@ -50,6 +50,7 @@ func Parse(content []byte, options ...ParseOption) ([]*SingleWorkflow, error) { runsOn[i] = evaluator.Interpolate(v) } job.RawRunsOn = encodeRunsOn(runsOn) + job.EraseNeeds() // there will be only one job in SingleWorkflow, it cannot have needs ret = append(ret, &SingleWorkflow{ Name: workflow.Name, RawOn: workflow.RawOn, diff --git a/pkg/jobparser/testdata/has_needs.out.yaml b/pkg/jobparser/testdata/has_needs.out.yaml index a544aa2..959960d 100644 --- a/pkg/jobparser/testdata/has_needs.out.yaml +++ b/pkg/jobparser/testdata/has_needs.out.yaml @@ -10,7 +10,6 @@ name: test jobs: job2: name: job2 - needs: job1 runs-on: linux steps: - run: uname -a @@ -19,7 +18,6 @@ name: test jobs: job3: name: job3 - needs: [job1, job2] runs-on: linux steps: - run: uname -a