From 1ff1442e38a02e5513d3bf7ea16f74e761d8f1c5 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 6 Nov 2024 16:41:45 -0500 Subject: [PATCH 1/3] SWI-6181 Update Action --- .github/workflows/test.yml | 17 ------------- action.yml | 51 ++++---------------------------------- 2 files changed, 5 insertions(+), 63 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de15df96..8dca2942 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,30 +9,13 @@ jobs: test: name: Test runs-on: ${{ fromJSON(vars.SWI_GLORG_UBUNTU_2204) }} - permissions: - id-token: write - contents: write steps: - - name: Get Github Token from Vault - uses: Bandwidth/vault-provider-action@v1 - with: - export-github-pat: true - - name: Checkout uses: actions/checkout@v4 - name: Run Test with Local Files - id: generate uses: ./ with: - branch-name: ci-cd-test - token: ${{ env.GITHUB_TEAM_ACCESS_TOKEN }} - openapi-generator-version: 6.5.0 language: python api-spec-path: ./utils/bandwidth.yml config: ./utils/test-config.yml - - - name: Delete Branch - if: ${{ always() }} - run: git push origin --delete ci-cd-test - shell: bash diff --git a/action.yml b/action.yml index 17bdb56c..f22f968e 100644 --- a/action.yml +++ b/action.yml @@ -1,43 +1,26 @@ name: Generate SDK Action description: Generate an SDK using the OpenAPI Generator Project inputs: - branch-name: - description: Branch name - required: true - token: - description: Github auth token - required: true language: description: The generator name (language) (`-g`) argument for the openapi-generator-cli required: true config: description: The configuration (`-c`) argument for the openapi-generator-cli - required: true - user-email: - description: Git user email - default: dx@bandwidth.com required: false - username: - description: Github username - default: DX-Bandwidth - required: false - openapi-generator-version: - description: The OpenAPI Generator project version, in `x.x.x` format - required: false - default: '6.5.0' + default: ./openapi-config.yml api-spec-path: description: The destination of the API Specification to generate a client from required: false default: ./bandwidth.yml + openapi-generator-version: + description: The OpenAPI Generator project version, in `x.x.x` format + required: false + default: '7.6.0' working-directory: description: The working directory to run the action in required: false default: ./ -outputs: - changes: - description: Boolean representing if files in the SDK were changed or not. - value: ${{ steps.commit.outputs.changes }} runs: using: composite @@ -47,14 +30,6 @@ runs: with: node-version: 20 - - name: Configure Git and Create Branch - run: | - git config user.email ${{ inputs.user-email }} - git config user.name ${{ inputs.username }} - git checkout -b ${{ inputs.branch-name }} - shell: bash - working-directory: ${{ inputs.working-directory }} - - name: Setup OpenAPI Generator CLI run: | npm install @openapitools/openapi-generator-cli -g @@ -71,19 +46,3 @@ runs: -o ./ shell: bash working-directory: ${{ inputs.working-directory }} - - - name: Commit if Necessary - id: commit - run: | - if git diff --quiet; then - echo "No Changes" - else - git add . - git commit -m "Generate SDK with OpenAPI Generator Version ${{ inputs.openapi-generator-version }}" - git push origin ${{ inputs.branch-name }} - echo "changes=true" >> $GITHUB_OUTPUT - fi - env: - GITHUB_TOKEN: ${{ inputs.token }} - shell: bash - working-directory: ${{ inputs.working-directory }} From 2db27079ccf5a817bea1408f97f43866d986bd85 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Thu, 7 Nov 2024 15:14:33 -0500 Subject: [PATCH 2/3] add additional-properties input --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f22f968e..07e1f562 100644 --- a/action.yml +++ b/action.yml @@ -16,12 +16,15 @@ inputs: description: The OpenAPI Generator project version, in `x.x.x` format required: false default: '7.6.0' + additional-properties: + description: Additional properties to pass to the generator + required: false + default: '' working-directory: description: The working directory to run the action in required: false default: ./ - runs: using: composite steps: @@ -43,6 +46,7 @@ runs: -g ${{ inputs.language }} \ -i ${{ inputs.api-spec-path }} \ -c ${{ inputs.config }} \ + ${{ inputs.additional-properties }} \ -o ./ shell: bash working-directory: ${{ inputs.working-directory }} From 050dedba062de23b7e6507e1df5ec4c805c273c2 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 8 Nov 2024 11:16:46 -0500 Subject: [PATCH 3/3] update readme --- README.md | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3e1ebdab..8c4a1e48 100644 --- a/README.md +++ b/README.md @@ -5,43 +5,27 @@ This action utilizes the [openapi-generator-cli](https://github.com/OpenAPITools ## Inputs ```yml -branch-name: - description: Branch name - required: true -token: - description: Github auth token - required: true language: description: The generator name (language) (`-g`) argument for the openapi-generator-cli required: true config: description: The configuration (`-c`) argument for the openapi-generator-cli - required: true -user-email: - description: Git user email - default: dx@bandwidth.com required: false -username: - description: Github username - default: DX-Bandwidth + default: ./openapi-config.yml +api-spec-path: + description: The destination of the API Specification to generate a client from required: false + default: ./bandwidth.yml openapi-generator-version: description: The OpenAPI Generator project version, in `x.x.x` format required: false - default: '6.5.0' -api-spec-path: - description: The destination of the API Specification to generate a client from + default: '7.6.0' +additional-properties: + description: Additional properties to pass to the generator required: false - default: ./bandwidth.yml -working-directory: + default: '' +working-directory: description: The working directory to run the action in required: false default: ./ ``` - -## Outputs - -```yml -changes: - description: Boolean representing if files in the SDK were changed or not. -```