Skip to content

GitHub Action

Java Scripting w/jbang

v0.16.1 Latest version
Use latest version

Java Scripting w/jbang

Run java as scripts with https:/ from your github repo


Copy and paste the following snippet into your .yml file.

- name: Java Scripting w/jbang
  uses: jbangdev/jbang-action@v0.16.1
Learn more about this action in jbangdev/jbang-action
Choose a version

JBang Container for Docker and Github Action

GitHub release badge GitHub license badge GitHub Workflows badge DockerHub Pulls

This container intended for quick and easily run java based scripts with jbang.

Can be used directly with docker or as a GitHub Action.

The source is located in jbangdev/jbang and are updated in this repo on every tag/release of jbangdev/jbang.


Container/Docker usage

Using dockerhub images:

docker run -v `pwd`:/ws --workdir=/ws jbangdev/jbang-action

Using images:

docker run -v `pwd`:/ws --workdir=/ws

Github Action


Key Example Description
trust Host pattern to add to be trusted before the script are executed.
jbangargs --verbose Arguments to pass to jbang before the script.
script 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 seperate arguments no matter how much quoting is done. If you need argument with spaces better to extend the docker file and call jbang directly.


Example usage

Here it is assumed you have a jbang script called in the root of your project.

on: [push]

    runs-on: ubuntu-latest
    name: A job to run jbang
    - name: checkout
      uses: actions/checkout@v1
    - uses: actions/cache@v1
        path: /root/.jbang
        key: $-jbang-$
        restore-keys: |
    - name: jbang
      uses: jbangdev/jbang-action@v0.97.0
        scriptargs: "my world"
        JBANG_REPO: /root/.jbang/repository
        GITHUB_TOKEN: $