mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
fix: skip local actions pre step in any case (#1204)
* fix: skip local actions pre step in any case We should skip local actions pre step, as it is not supported by github. In turn we may need to late prepare remote actions which are run as steps in a local composite action. Fixes #1193 * test: remove obsolete test case Since local actions does not run any pre-step anymore we don't test this case. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
70c44da5a6
commit
bb20108d52
3 changed files with 35 additions and 78 deletions
|
@ -28,9 +28,16 @@ func (sal *stepActionLocal) pre() common.Executor {
|
|||
sal.env = map[string]string{}
|
||||
|
||||
return func(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (sal *stepActionLocal) main() common.Executor {
|
||||
return runStepExecutor(sal, stepStageMain, func(ctx context.Context) error {
|
||||
if common.Dryrun(ctx) {
|
||||
return nil
|
||||
}
|
||||
|
||||
actionDir := filepath.Join(sal.getRunContext().Config.Workdir, sal.Step.Uses)
|
||||
|
||||
localReader := func(ctx context.Context) actionYamlReader {
|
||||
|
@ -55,23 +62,6 @@ func (sal *stepActionLocal) pre() common.Executor {
|
|||
|
||||
sal.action = actionModel
|
||||
|
||||
// run local pre step only for composite actions, to allow to run
|
||||
// inside pre steps
|
||||
if sal.action.Runs.Using == model.ActionRunsUsingComposite {
|
||||
sal.RunContext.setupActionInputs(sal)
|
||||
return runStepExecutor(sal, stepStagePre, runPreStep(sal)).If(hasPreStep(sal)).If(shouldRunPreStep(sal))(ctx)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (sal *stepActionLocal) main() common.Executor {
|
||||
return runStepExecutor(sal, stepStageMain, func(ctx context.Context) error {
|
||||
if common.Dryrun(ctx) {
|
||||
return nil
|
||||
}
|
||||
actionDir := filepath.Join(sal.getRunContext().Config.Workdir, sal.Step.Uses)
|
||||
return sal.runAction(sal, actionDir, nil)(ctx)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue