From 960e21db066b1326b191e8d0c39e2f60da07058c Mon Sep 17 00:00:00 2001 From: jaron Date: Sun, 18 Aug 2024 10:56:49 +0800 Subject: [PATCH] feat(action): support transer image version --- Dockerfile | 4 ++-- README.md | 10 +++++++++- action.yml | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 165fef8..0d91fe3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG JZERO_VERSION=latest +ARG VERSION=latest -FROM jaronnie/jzero:${JZERO_VERSION} +FROM jaronnie/jzero:${VERSION} CMD ["jzero", "-h"] \ No newline at end of file diff --git a/README.md b/README.md index 9026de8..c04888b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # jzero-action -jzero github action +jzero github action for running [jzero](https://github.com/jzero-io/jzero) command + +## Usage ```yaml name: jzero-action-test @@ -21,4 +23,10 @@ jobs: - uses: jzero-io/jzero-action@v0.0.1 with: args: gen sdk --module github.com/jzero/test -d test + version: v0.23.4 ``` + +## References + +* https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action +* https://github.com/orgs/community/discussions/115697 \ No newline at end of file diff --git a/action.yml b/action.yml index 24832e7..89e4d6f 100644 --- a/action.yml +++ b/action.yml @@ -19,7 +19,7 @@ inputs: runs: using: 'docker' image: 'Dockerfile' - build-args: - JZERO_VERSION: ${{ inputs.version }} args: - - ${{ inputs.args }} \ No newline at end of file + - ${{ inputs.args }} + - '--build-arg' + - 'VERSION=${{inputs.version}}' \ No newline at end of file