Skip to content

jbangdev/jbang-action

Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Source

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.

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.105.2
      with:
        script: createissue.java
        scriptargs: "my world"
      env:
        JBANG_REPO: /root/.jbang/repository
        GITHUB_TOKEN: $