Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/borkdude/cherry-action-example
Github action implemented with cherry
https://github.com/borkdude/cherry-action-example
cherry-cljs clojure clojurescript
Last synced: 12 days ago
JSON representation
Github action implemented with cherry
- Host: GitHub
- URL: https://github.com/borkdude/cherry-action-example
- Owner: borkdude
- Created: 2022-07-28T10:02:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-28T10:25:02.000Z (over 2 years ago)
- Last Synced: 2024-10-05T00:41:00.197Z (about 1 month ago)
- Topics: cherry-cljs, clojure, clojurescript
- Language: Clojure
- Homepage:
- Size: 85.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cherry-action-example
This is an example of how to use [cherry](https://github.com/borkdude/cherry), a JS-tooling friendly CLJS compiler, 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.## Running locally
Edit `action.cljs`, the ClojureScript source for this action.
Run:
``` shell
npm run action
```to run the action locally. This will produce `action.mjs` which will be run by Node.js.
## Bundle
To bundle `action.mjs` using `ncc`, run: `npm run bundle`. This will create
the standalone JS file `dist/index.mjs`.## 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 }}"
```