mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
Add support for composite actions (#514)
* Add support for composite actions * Fix to make more complex composite actions work * Fix to make more complex composite actions work * Let's validate the steps in the composite steps to fail on uses and run's without shell, like the real world * Add support for composite actions * Add workflow to test composite actions * Log instead of panicing when output is mismatched * Merge maps so environment variables are not lost * Remove Debug * Correect merge error * Remove invalid composite tests. * Fix composite test Co-authored-by: Casey Lee <cplee@nektos.com> Co-authored-by: monkers <mikem@msquaredconsulting.co.uk> Co-authored-by: Mike Moncrieffe <69815687+mikemonkers@users.noreply.github.com>
This commit is contained in:
parent
952e823339
commit
13092e269b
11 changed files with 236 additions and 16 deletions
|
@ -312,6 +312,15 @@ func (s *Step) Type() StepType {
|
|||
return StepTypeUsesActionRemote
|
||||
}
|
||||
|
||||
func (s *Step) Validate() error {
|
||||
if s.Type() != StepTypeRun {
|
||||
return fmt.Errorf("(StepID: %s): Unexpected value 'uses'", s.String())
|
||||
} else if s.Shell == "" {
|
||||
return fmt.Errorf("(StepID: %s): Required property is missing: 'shell'", s.String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ReadWorkflow returns a list of jobs for a given workflow file reader
|
||||
func ReadWorkflow(in io.Reader) (*Workflow, error) {
|
||||
w := new(Workflow)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue