From 5fae69865825f8c7374109034933dcabe0f19604 Mon Sep 17 00:00:00 2001 From: deekshith Date: Thu, 20 Jul 2023 18:42:16 +0530 Subject: [PATCH 1/4] added a workflow to validate meta.yaml when ever a PR is made to main branch --- .github/workflows/openapi_validation.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/openapi_validation.yml diff --git a/.github/workflows/openapi_validation.yml b/.github/workflows/openapi_validation.yml new file mode 100644 index 00000000..d9aa313a --- /dev/null +++ b/.github/workflows/openapi_validation.yml @@ -0,0 +1,20 @@ +name: Validate OpenAPI Schema + +on: + pull_request: + branches: + - main + +jobs: + validate_openapi_schema: + name: Validate OpenAPI Schema + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Validate OpenAPI schema + uses: thiyagu06/openapi-validator-action@v1 + with: + filepath: "./api/meta/build/meta.yaml" From ecdb11e4d17e757421cf9848d434964de40d740d Mon Sep 17 00:00:00 2001 From: deekshith Date: Thu, 20 Jul 2023 18:43:41 +0530 Subject: [PATCH 2/4] changed branch name --- .github/workflows/openapi_validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/openapi_validation.yml b/.github/workflows/openapi_validation.yml index d9aa313a..ce3aa45c 100644 --- a/.github/workflows/openapi_validation.yml +++ b/.github/workflows/openapi_validation.yml @@ -3,7 +3,7 @@ name: Validate OpenAPI Schema on: pull_request: branches: - - main + - master jobs: validate_openapi_schema: From 5995fe1920b09fa3e023bbbc0f1f1505a75bcdb6 Mon Sep 17 00:00:00 2001 From: deekshith Date: Thu, 20 Jul 2023 18:56:50 +0530 Subject: [PATCH 3/4] added validation status --- .github/workflows/openapi_validation.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/openapi_validation.yml b/.github/workflows/openapi_validation.yml index ce3aa45c..c454386e 100644 --- a/.github/workflows/openapi_validation.yml +++ b/.github/workflows/openapi_validation.yml @@ -18,3 +18,10 @@ jobs: uses: thiyagu06/openapi-validator-action@v1 with: filepath: "./api/meta/build/meta.yaml" + + - name: Check validation status + run: | + if [ "${{ steps.validation.outcome }}" == 'failure' ]; then + echo "OpenAPI validation failed. Blocking the pull request merge." + exit 1 + fi From 10d4e965d126069e8080ba8b4e8cc0e1a9c40b51 Mon Sep 17 00:00:00 2001 From: deekshith Date: Thu, 20 Jul 2023 18:59:24 +0530 Subject: [PATCH 4/4] invalid meta --- api/meta/build/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/meta/build/meta.yaml b/api/meta/build/meta.yaml index 4992bd2a..b45bbaef 100644 --- a/api/meta/build/meta.yaml +++ b/api/meta/build/meta.yaml @@ -93,7 +93,7 @@ paths: $ref: '#/paths/~1return_reasons/post/responses/default' /return_reasons: post: - tags: + tags:fa fasdf asf asf a - Beckn Application Platform (BPP) description: BPP provides the list of return reasons to the BAP requestBody: