Skip to content

Commit

Permalink
feat(github-action): Add with keyword
Browse files Browse the repository at this point in the history
This is a follow-up to SchemaStore#1803 where `uses` was added. `with` is also allowed. I am not sure how to define the constraint where `with` can only be used when `uses` is defined.

See https://github.blog/changelog/2021-08-25-github-actions-reduce-duplication-with-action-composition/ for more information
  • Loading branch information
billyvg committed Aug 30, 2021
1 parent 8cc6d11 commit 9bf0755
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/schemas/json/github-action.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
"description": "Selects an action to run as part of a step in your job.",
"type": "string"
},
"with": {
"$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith",
"description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.",
"type": "object"
},
"name": {
"$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname",
"description": "The name of the composite run step.",
Expand Down
7 changes: 7 additions & 0 deletions src/test/github-action/composite-run-steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
"run": "echo $FOO",
"shell": "bash --noprofile {0}",
"working-directory": "$HOME"
},
{
"id": "pleasantries",
"uses": "action/checkout@v2",
"with": {
"ref": "main"
}
}
]
}
Expand Down

0 comments on commit 9bf0755

Please sign in to comment.