From e3813495ab35580b6e46fd342960bd6432a652f4 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 31 Mar 2026 20:09:17 -0400 Subject: [PATCH] feat(action): add optional input name - Add a name input to customize the installed OpenAPI Generator CLI wrapper - Document and test the custom binary name behavior --- .github/workflows/test.yml | 8 ++++++++ README.md | 12 +++++++++++- action.yml | 10 +++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff3a246..61c2175 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,3 +34,11 @@ jobs: openapi-generator-cli --version exit 1 fi + + - name: Run action with name + uses: ./ + with: + name: openapi-generator + + - name: Check name + run: openapi-generator version diff --git a/README.md b/README.md index 1878595..6a70dd3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 🟢 Set up GitHub Actions workflow with [OpenAPI Generator CLI](https://openapi-generator.tech/docs/installation/). -This action installs Java, downloads the OpenAPI Generator CLI JAR, caches it by version, and exposes `openapi-generator-cli` on `PATH`. +This action installs Java, downloads the OpenAPI Generator CLI JAR, caches it by version, and exposes a binary on `PATH`. ## Quick Start @@ -52,6 +52,16 @@ See [action.yml](action.yml) version: 7.21.0 ``` +### `name` + +**Optional**: The OpenAPI Generator CLI binary name. Defaults to `openapi-generator-cli`. + +```yaml +- uses: remarkablemark/setup-openapi@v1 + with: + name: openapi-generator-cli +``` + ## License [MIT](LICENSE) diff --git a/action.yml b/action.yml index 7ed205d..78970d8 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,9 @@ inputs: version: description: OpenAPI Generator CLI version default: 7.21.0 + name: + description: OpenAPI Generator CLI name + default: openapi-generator-cli runs: using: composite @@ -53,13 +56,13 @@ runs: BIN_DIR="$RUNNER_TEMP/openapi-generator-cli-bin" mkdir -p "$BIN_DIR" - cat > "$BIN_DIR/openapi-generator-cli" < "$BIN_DIR/$NAME" < "$BIN_DIR/openapi-generator-cli.cmd" < "$BIN_DIR/$NAME.cmd" <> "$GITHUB_PATH" env: JAR_PATH: ${{ steps.path.outputs.JAR_PATH }} + NAME: ${{ inputs.name }} branding: icon: check-circle