Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/borkdude/nbb-action-example
An example of writing a Github action with nbb
https://github.com/borkdude/nbb-action-example
clojurescript github-actions nbbjs nodejs
Last synced: 3 months ago
JSON representation
An example of writing a Github action with nbb
- Host: GitHub
- URL: https://github.com/borkdude/nbb-action-example
- Owner: borkdude
- Created: 2021-09-12T15:28:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-14T09:59:48.000Z (over 2 years ago)
- Last Synced: 2024-10-04T12:58:32.590Z (4 months ago)
- Topics: clojurescript, github-actions, nbbjs, nodejs
- Language: Clojure
- Homepage:
- Size: 1.78 MB
- Stars: 25
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nbb-action-example
This is an example of how to use [nbb](https://github.com/borkdude/nbb), an
ad-hoc CLJS scripting tool for Node.js, to implement a Github action.This action prints "Hello World" or "Hello" + the name of a person to greet to the log.
It was created using
[this](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action)
tutorial but instead of JavaScript it uses a small JS wrapper `index.mjs` + the
actual CLJS script `action.cljs`.## Running locally
Run:
``` shell
npm run action
```to run the action locally.
## Bundle
To bundle `action.cljs` using `ncc`, run: `npm run bundle`. This will create
the standalone JS file `dist/index.mjs`.See [bundle](https://github.com/babashka/nbb/tree/main/doc/bundle) for more
details.## Inputs
## `who-to-greet`
**Required** The name of the person to greet. Default `"World"`.
## Outputs
## `time`
The time we greeted you.
## Example usage
``` yaml
on: [push]jobs:
hello_world_job:
runs-on: ubuntu-latest
name: A job to say hello
steps:
- name: Hello world action step
id: hello
uses: borkdude/[email protected]
with:
who-to-greet: 'Mona the Octocat'
# Use the output from the `hello` step
- name: Get the output time
run: echo "The time was ${{ steps.hello.outputs.time }}"
```