Skip to content

Commit 935e37c

Browse files
authored
feat: support node20 runtime (#1988)
* feat: support node20 * fix * more fixes * maybe final fixes? * format
1 parent 19764bc commit 935e37c

File tree

503 files changed

+160201
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

503 files changed

+160201
-7
lines changed

pkg/model/action.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ func (a *ActionRunsUsing) UnmarshalYAML(unmarshal func(interface{}) error) error
2020
// Force input to lowercase for case insensitive comparison
2121
format := ActionRunsUsing(strings.ToLower(using))
2222
switch format {
23-
case ActionRunsUsingNode16, ActionRunsUsingNode12, ActionRunsUsingDocker, ActionRunsUsingComposite:
23+
case ActionRunsUsingNode20, ActionRunsUsingNode16, ActionRunsUsingNode12, ActionRunsUsingDocker, ActionRunsUsingComposite:
2424
*a = format
2525
default:
2626
return fmt.Errorf(fmt.Sprintf("The runs.using key in action.yml must be one of: %v, got %s", []string{
2727
ActionRunsUsingComposite,
2828
ActionRunsUsingDocker,
2929
ActionRunsUsingNode12,
3030
ActionRunsUsingNode16,
31+
ActionRunsUsingNode20,
3132
}, format))
3233
}
3334
return nil
@@ -36,8 +37,10 @@ func (a *ActionRunsUsing) UnmarshalYAML(unmarshal func(interface{}) error) error
3637
const (
3738
// ActionRunsUsingNode12 for running with node12
3839
ActionRunsUsingNode12 = "node12"
39-
// ActionRunsUsingNode12 for running with node16
40+
// ActionRunsUsingNode16 for running with node16
4041
ActionRunsUsingNode16 = "node16"
42+
// ActionRunsUsingNode20 for running with node20
43+
ActionRunsUsingNode20 = "node20"
4144
// ActionRunsUsingDocker for running with docker
4245
ActionRunsUsingDocker = "docker"
4346
// ActionRunsUsingComposite for running composite

pkg/runner/action.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func runActionImpl(step actionStep, actionDir string, remoteAction *remoteAction
149149
logger.Debugf("type=%v actionDir=%s actionPath=%s workdir=%s actionCacheDir=%s actionName=%s containerActionDir=%s", stepModel.Type(), actionDir, actionPath, rc.Config.Workdir, rc.ActionCacheDir(), actionName, containerActionDir)
150150

151151
switch action.Runs.Using {
152-
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16:
152+
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16, model.ActionRunsUsingNode20:
153153
if err := maybeCopyToActionDir(ctx, step, actionDir, actionPath, containerActionDir); err != nil {
154154
return err
155155
}
@@ -176,6 +176,7 @@ func runActionImpl(step actionStep, actionDir string, remoteAction *remoteAction
176176
model.ActionRunsUsingDocker,
177177
model.ActionRunsUsingNode12,
178178
model.ActionRunsUsingNode16,
179+
model.ActionRunsUsingNode20,
179180
model.ActionRunsUsingComposite,
180181
}, action.Runs.Using))
181182
}
@@ -456,7 +457,8 @@ func hasPreStep(step actionStep) common.Conditional {
456457
action := step.getActionModel()
457458
return action.Runs.Using == model.ActionRunsUsingComposite ||
458459
((action.Runs.Using == model.ActionRunsUsingNode12 ||
459-
action.Runs.Using == model.ActionRunsUsingNode16) &&
460+
action.Runs.Using == model.ActionRunsUsingNode16 ||
461+
action.Runs.Using == model.ActionRunsUsingNode20) &&
460462
action.Runs.Pre != "")
461463
}
462464
}
@@ -471,7 +473,7 @@ func runPreStep(step actionStep) common.Executor {
471473
action := step.getActionModel()
472474

473475
switch action.Runs.Using {
474-
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16:
476+
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16, model.ActionRunsUsingNode20:
475477
// defaults in pre steps were missing, however provided inputs are available
476478
populateEnvsFromInput(ctx, step.getEnv(), action, rc)
477479
// todo: refactor into step
@@ -551,7 +553,8 @@ func hasPostStep(step actionStep) common.Conditional {
551553
action := step.getActionModel()
552554
return action.Runs.Using == model.ActionRunsUsingComposite ||
553555
((action.Runs.Using == model.ActionRunsUsingNode12 ||
554-
action.Runs.Using == model.ActionRunsUsingNode16) &&
556+
action.Runs.Using == model.ActionRunsUsingNode16 ||
557+
action.Runs.Using == model.ActionRunsUsingNode20) &&
555558
action.Runs.Post != "")
556559
}
557560
}
@@ -586,7 +589,7 @@ func runPostStep(step actionStep) common.Executor {
586589
_, containerActionDir := getContainerActionPaths(stepModel, actionLocation, rc)
587590

588591
switch action.Runs.Using {
589-
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16:
592+
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16, model.ActionRunsUsingNode20:
590593

591594
populateEnvsFromSavedState(step.getEnv(), step, rc)
592595

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Updating
2+
3+
If an update to this app is required, it must be done manually via `npm run-script build` since the `node_modules` are not shared.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Hello World'
2+
description: 'Greet someone and record the time'
3+
inputs:
4+
who-to-greet: # id of input
5+
description: 'Who to greet'
6+
required: true
7+
default: 'World'
8+
outputs:
9+
time: # id of output
10+
description: 'The time we greeted you'
11+
runs:
12+
using: 'node20'
13+
main: 'dist/index.js'

0 commit comments

Comments
 (0)