GitHub Action to execute Javascript within workflows.
- Executes any Javascript code
- Inputs and outputs can be overridden
- Can read arbitrary inputs and write arbitrary outputs
Input |
Default |
Description |
js * |
- |
Javascript code. |
js_input |
js |
Override default name js input with Javascript code |
js_result |
result |
Override default name result output with Javascript execution result |
Output |
Description |
result |
Javascript execution result |
- name: Execute Javascript
uses: amochkin/action-javascript@v1
with:
js: |
console.log('Hello World!')
- name: Execute Javascript
uses: amochkin/action-javascript@v1
with:
input_1: 'Hello'
js: |
`${input("input_1")} World!`
- name: Execute Javascript
uses: amochkin/action-javascript@v1
id: <step_id>
with:
js: |
output("Hello World!", "output_1")
- name: Print output
run: echo ${{ steps.<step_id>.outputs.output_1 }}