mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
fix: allow using the env context in actions defaults (#204)
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/204 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
57524e90f1
commit
34939ad5f4
2 changed files with 30 additions and 0 deletions
|
@ -166,6 +166,7 @@
|
|||
"context": [
|
||||
"forge",
|
||||
"github",
|
||||
"env",
|
||||
"strategy",
|
||||
"matrix",
|
||||
"job",
|
||||
|
|
|
@ -120,3 +120,32 @@ jobs:
|
|||
}
|
||||
require.NoError(t, n.UnmarshalYAML(&node))
|
||||
}
|
||||
|
||||
func TestActionSchema(t *testing.T) {
|
||||
var node yaml.Node
|
||||
err := yaml.Unmarshal([]byte(`
|
||||
name: 'action name'
|
||||
author: 'action authors'
|
||||
description: |
|
||||
action description
|
||||
inputs:
|
||||
url:
|
||||
description: 'url description'
|
||||
default: '${{ env.GITHUB_SERVER_URL }}'
|
||||
repo:
|
||||
description: 'repo description'
|
||||
default: '${{ github.repository }}'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- run: echo "${{ github.action_path }}"
|
||||
`), &node)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
err = (&Node{
|
||||
Definition: "action-root",
|
||||
Schema: GetActionSchema(),
|
||||
}).UnmarshalYAML(&node)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue