diff --git a/Dockerfile b/Dockerfile index a5de08d..c3ea7e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM openjdk:17-slim -# Add Loki-dist.zip to the Docker image -ADD target/*.tar.gz /opt/loki +RUN apt-get update && apt-get install -y curl unzip COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/action.yml b/action.yml index f7f37fc..6a57ad0 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: 'loki-sync-jira-to-github' -description: 'Synchronize Jira issues to GitHub repositories' +name: 'Loki Action' +description: 'A GitHub Action synchronize Jira issues to GitHub repositories' inputs: from-jira: description: 'Flag to indicate from Jira' @@ -9,7 +9,7 @@ inputs: required: true runs: using: 'docker' - image: 'quay.io/aurora-labs-42/loki-action:latest' + image: 'Dockerfile' args: - ${{ inputs.from-jira }} - ${{ inputs.to-repo }} diff --git a/entrypoint.sh b/entrypoint.sh index 659967f..4718f40 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,4 +5,12 @@ set -e FROM_JIRA=$1 TO_REPO=$2 +# Get the latest tag from the GitHub releases +LATEST_TAG=$(curl --silent "https://api.github.com/repos/aurora-labs-42/loki/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + +# Download the JAR file +curl -L -o loki-dist.zip https://github.com/aurora-labs-42/loki/releases/download/${LATEST_TAG}/loki-${LATEST_TAG}-dist.zip +unzip loki-dist.zip + +# Assuming the JAR file is named loki.jar inside the unzipped directory java -jar quarkus-run.jar --from-jira --to-repo=${TO_REPO}