From 32675d0cb16c6bcded1cfc4710b7f1101170a7a3 Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Mon, 26 Feb 2024 16:20:07 +0100 Subject: [PATCH] Call git commands to commit changes --- .../generate-single-openapi-spec.yaml | 30 +++++++++++++++++-- generator/script/generate.sh | 4 --- openapi.yaml | 1 + 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-single-openapi-spec.yaml b/.github/workflows/generate-single-openapi-spec.yaml index efc0060e..42fa86a5 100644 --- a/.github/workflows/generate-single-openapi-spec.yaml +++ b/.github/workflows/generate-single-openapi-spec.yaml @@ -6,7 +6,7 @@ on: - main pull_request: jobs: - build-single-files: + build-single-spec: runs-on: ubuntu-latest container: image: openapitools/openapi-generator-cli:v7.3.0 @@ -17,9 +17,33 @@ jobs: - name: Install pre-requisites run: | apt-get update - apt-get install gettext-base + apt-get install -yqq \ + gettext-base - name: Build single-file Onfido OpenAPI defintions run: | ./generator/script/generate.sh \ generator/configuration/openapi.yaml \ - generator/configuration/openapi-yaml.yaml \ No newline at end of file + generator/configuration/openapi-yaml.yaml + - name: Store generated artifacts + uses: actions/upload-artifact@v2 + with: + name: artifacts-${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }} + path: generated/artifacts + commit-single-spec: + runs-on: ubuntu-latest + needs: build-single-spec + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v2 + with: + name: artifacts-${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }} + path: generated/artifacts + - name: Commit changes + run: | + git --version + git config user.name "GitHub Actions Bot" + git config user.email "<>" + git status --porcelain && git add generated/artifacts && \ + git commit -m "Update single file spec" + git status + git log diff --git a/generator/script/generate.sh b/generator/script/generate.sh index f1373c3f..49cf8c09 100755 --- a/generator/script/generate.sh +++ b/generator/script/generate.sh @@ -35,8 +35,4 @@ do fi done -pwd -ls * -head ./schemas/workflow_runs/workflow_run_builder.yaml - ${OPENAPI_GENERATOR_COMMAND} batch --clean ${GENERATED_CONFIG_FILES} diff --git a/openapi.yaml b/openapi.yaml index 78758a45..89ef2574 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5,6 +5,7 @@ info: version: 3.6.0 contact: name: Onfido + url: https://onfido.com email: engineering@onfido.com license: name: MIT