Skip to content

Commit

Permalink
add runner.environment prop (fix #412)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Apr 16, 2024
1 parent 208b9ac commit e032103
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 7 additions & 6 deletions expr_sema.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ var BuiltinGlobalVariableTypes = map[string]ExprType{
"steps": NewEmptyStrictObjectType(), // This value will be updated contextually
// https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
"runner": NewStrictObjectType(map[string]ExprType{
"name": StringType{},
"os": StringType{},
"arch": StringType{},
"temp": StringType{},
"tool_cache": StringType{},
"debug": StringType{},
"name": StringType{},
"os": StringType{},
"arch": StringType{},
"temp": StringType{},
"tool_cache": StringType{},
"debug": StringType{},
"environment": StringType{}, // https://github.com/github/docs/issues/32443
}),
// https://docs.github.com/en/actions/learn-github-actions/contexts#secrets-context
"secrets": NewMapObjectType(StringType{}),
Expand Down
8 changes: 8 additions & 0 deletions testdata/ok/issue-412_runner_environment_prop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
on: push

jobs:
job-level:
runs-on: ubuntu-latest
steps:
- run: echo 'self-hosted runner'
if: ${{ runner.environment == 'self-hosted' }}

0 comments on commit e032103

Please sign in to comment.