Skip to content

Commit 9c83d24

Browse files
committed
Update README.md
1 parent f5df157 commit 9c83d24

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,60 @@
22

33
This action makes it easy to quickly write and execute an Elixir script in your workflow.
44

5-
To use this action, provide an input named `script` that contains the body of an Elixir function call.
5+
To use this action, provide an input named `script` that contains Elixir code:
66

7-
The following arguments are available in the script's context:
7+
```yaml
8+
- uses: gaggle/elixir_script@v0
9+
with:
10+
script: |
11+
IO.puts("Magic, just like the potions in Elixir ✨")
12+
```
13+
14+
### Bindings
15+
16+
The following arguments are available in the script's bindings:
17+
18+
* `context`: A map containing the context of the workflow run.
19+
It can be accessed like this:
20+
```yaml
21+
script: |
22+
"🚀 Pushed to #{context.payload.repository.name} by @#{context.actor}!
23+
```
824

9-
* `context` A map containing the context of the workflow run
25+
_These bindings are already defined,
26+
so you don't have to import them._
1027

11-
Since the script is just a function body, these values will already be defined, so you don't have to import them.
28+
### Outputs
1229

1330
The return value of the script will be in the step's `outputs.result`:
1431

1532
```yaml
1633
- uses: gaggle/elixir_script@v0
1734
id: script
1835
with:
19-
script: "<your_elixir_code_here>"
36+
script: |
37+
"Oh hi Mark!"
2038
2139
- name: Get result
2240
run: echo "${{steps.script.outputs.result}}"
2341
```
2442

25-
See [.github/workflows/examples.yml](.github/workflows/examples.yml) for more detailed examples of how this can be used.
43+
See [.github/workflows/examples.yml](.github/workflows/examples.yml) for more examples.
2644

2745
## Acknowledgements
2846

2947
### Inspired by [GitHub Script][github-script]
3048

31-
This Elixir Script action is based on the amazing [GitHub Script action][github-script],
49+
This Elixir Script action is based on the [GitHub Script action][github-script],
3250
which is primarily built around Javascript.
3351
Elixir Script adapts its interfaces and functionality to the Elixir environment,
3452
aiming to provide a seamless experience for Elixir developers.
35-
Many thanks to the creators and contributors of GitHub Script.
53+
Many thanks to the creators and contributors of GitHub Script!
3654

3755
## Releasing
3856

3957
[New releases](https://github.com/gaggle/elixir_script/releases) are automatically created
40-
when [`.pkgx.yaml`](.pkgx.yaml)'s `VERSION` key is incremented.
58+
when [`.pkgx.yaml`](.pkgx.yaml)'s `VERSION` is incremented.
4159
The release must then be edited and then immediately resaved to publish it to the Actions Marketplace
4260

4361
(This is a built-in limitation of GitHub releases

0 commit comments

Comments
 (0)