Run arbitrary Amber script via GitHub Actions. Inspired by actions/github-script.
Note
This is a composite action because I want less maintaining costs. There is a limitation of composite action itself:
- Name of steps are not displayed. (GitHub discussion)
See action.yaml
- uses: lens0021/amber-script-action@v1
with:
# The script to run.
script: ""
# The version to use.
# Examples: 0.4.0-alpha, 0.3.5-alpha
# Default: 0.4.0-alpha
amber-version: ""
# Whether to cache Amber binaries and the compiled bash scripts
# Default: true
enable-cache: ""
# The path to store Amber binaries and the compiled bash scripts.
# If empty string is given, the used path depends on the runner.
# Default (Linux): '/home/runner/.amber-script-action'
# Default (Mac): '/Users/runner/.amber-script-action'
cache-path: ""Basic:
on: push
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: lens0021/amber-script-action@v1
with:
script: |
const msg = "Hello World!"
echo msg
echo "The length of the previous message is {len msg}."This action is designed for light-weight inline scripting directly in your workflow files.
If you need to execute larger Amber programs from separate files, use lens0021/setup-amber instead:
- uses: lens0021/setup-amber@v2
with:
amber-version: 0.5.1-alpha
- run: amber your-script.abThis approach gives you proper syntax highlighting, LSP integration, and keeps your workflow files concise.