https://github.com/jbangdev/jbang-action
Docker image and Github Action to run jbang scripts
https://github.com/jbangdev/jbang-action
jreleaser-managed
Last synced: 4 months ago
JSON representation
Docker image and Github Action to run jbang scripts
- Host: GitHub
- URL: https://github.com/jbangdev/jbang-action
- Owner: jbangdev
- License: mit
- Created: 2020-01-14T04:53:55.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-10-04T11:24:36.000Z (6 months ago)
- Last Synced: 2025-11-14T11:40:02.612Z (4 months ago)
- Topics: jreleaser-managed
- Language: Dockerfile
- Homepage: https://github.com/marketplace/actions/java-scripting-w-jbang
- Size: 434 MB
- Stars: 42
- Watchers: 3
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JBang Container for Docker and Github Action
[](https://github.com/jbangdev/jbang-action/releases/latest)
[]()
[](https://github.com/search?q=jbang-action+language%3AYAML+language%3AYAML+path%3A.github%2Fworkflows&type=Code&ref=advsearch&l=&l=)
[]()
This container intended for quick and easily run java based scripts with [jbang](https://jbang.dev).
Can be used directly with docker or as a GitHub Action.
The source is located in [jbangdev/jbang](https://github.com/jbangdev/jbang/blob/HEAD/src/jreleaser/distributions/jbang-action/docker/) and are updated in this repo on every tag/release of jbangdev/jbang.
[Source](https://github.com/jbangdev/jbang-action)
## Container/Docker usage
Using dockerhub images:
```
docker run -v `pwd`:/ws --workdir=/ws jbangdev/jbang-action helloworld.java
```
Using quay.io images:
```
docker run -v `pwd`:/ws --workdir=/ws quay.io/jbangdev/jbang-action helloworld.java
```
## Github Action
### Inputs
Key | Example | Description
----|---------|------------
trust | `https://github.com/maxandersen` | Host pattern to add to be trusted before the script are executed.
jbangargs | `--verbose` | Arguments to pass to jbang before the script.
script | `hello.java` | File, URL or alias referring to script to run
scriptargs | `--token ${GITHUB_TOKEN}` | Arguments to pass to the script. Note: due to how github actions + docker arguments containing spaces gets treated as separate arguments no matter how much quoting is done. If you need argument with spaces better to extend the docker file and call jbang directly.
### Outputs
### Example usage
Here it is assumed you have a jbang script called `createissue.java` in the root of your project.
```yaml
on: [push]
jobs:
jbang:
runs-on: ubuntu-latest
name: A job to run jbang
steps:
- name: checkout
uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: /root/.jbang
key: $-jbang-$
restore-keys: |
$-jbang-
- name: jbang
uses: jbangdev/jbang-action@v0.132.1
with:
script: createissue.java
scriptargs: "my world"
env:
JBANG_REPO: /root/.jbang/repository
GITHUB_TOKEN: $
```