Skip to content

Commit cdc6d4b

Browse files
sillyguodongwolfogre
authored andcommitted
Support expression in uses (#75)
Since actions can specify the download source via a url prefix. The prefix may contain some sensitive information that needs to be stored in secrets or variable context, so we need to interpolate the expression value for`uses` firstly. Reviewed-on: https://gitea.com/gitea/act/pulls/75 Co-authored-by: sillyguodong <[email protected]> Co-committed-by: sillyguodong <[email protected]>
1 parent 2069b04 commit cdc6d4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/runner/step_action_remote.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
3939
return nil
4040
}
4141

42+
// For gitea:
43+
// Since actions can specify the download source via a url prefix.
44+
// The prefix may contain some sensitive information that needs to be stored in secrets,
45+
// so we need to interpolate the expression value for uses first.
46+
sar.Step.Uses = sar.RunContext.NewExpressionEvaluator(ctx).Interpolate(ctx, sar.Step.Uses)
47+
4248
sar.remoteAction = newRemoteAction(sar.Step.Uses)
4349
if sar.remoteAction == nil {
4450
return fmt.Errorf("Expected format {org}/{repo}[/path]@ref. Actual '%s' Input string was not in a correct format", sar.Step.Uses)

0 commit comments

Comments
 (0)