Skip to content

Commit

Permalink
Merge branch 'issue-130' (fixes #130)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Apr 7, 2022
2 parents f48ba7f + 8aaa668 commit ae6b1fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion expr_sema.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,11 @@ func (sema *ExprSemanticsChecker) UpdateSecrets(ty *ObjectType) {
sema.ensureVarsCopied()

// Merges automatically supplied secrets with manually defined secrets.
// ACTIONS_STEP_DEBUG and ACTIONS_RUNNER_DEBUG seem supplied from caller of the workflow (#130)
copied := NewStrictObjectType(map[string]ExprType{
"github_token": StringType{},
"github_token": StringType{},
"actions_step_debug": StringType{},
"actions_runner_debug": StringType{},
})
for n, v := range ty.Props {
copied.Props[n] = v
Expand Down
16 changes: 16 additions & 0 deletions expr_sema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,22 @@ func TestExprSemanticsCheckOK(t *testing.T) {
"foo": StringType{},
}),
},
{
what: "automatically supplied secret",
input: "secrets.ACTIONS_STEP_DEBUG",
expected: StringType{},
secrets: NewStrictObjectType(map[string]ExprType{
"foo": StringType{},
}),
},
{
what: "automatically supplied secret",
input: "secrets.ACTIONS_RUNNER_DEBUG",
expected: StringType{},
secrets: NewStrictObjectType(map[string]ExprType{
"foo": StringType{},
}),
},
{
what: "jobs object",
input: "jobs.some_job",
Expand Down

0 comments on commit ae6b1fa

Please sign in to comment.