diff --git a/.github/workflows/update_openapi_spec.yml b/.github/workflows/update_openapi_spec.yml new file mode 100644 index 0000000000000..07d28dee8eccf --- /dev/null +++ b/.github/workflows/update_openapi_spec.yml @@ -0,0 +1,25 @@ +name: Update OpenAPI Spec + +on: + push: + branches: + - master + paths: + - '**/*openapi.yaml' + - '**/*openapi.yml' + workflow_dispatch: + +jobs: + update-openapi-spec: + runs-on: ubuntu-latest + + steps: + # This step dispatches a workflow in the OpenAPI repo, updating the spec and opening a PR. + - name: Dispatch update spec workflow + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PRO_ACCESS_TOKEN }} + repository: localstack/openapi + event-type: openapi-update + # A git reference is needed when we want to dispatch the worflow from another branch. + client-payload: '{"ref": "${{ github.ref }}", "repo": "${{ github.repository }}"}' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b44d5980aa4d..07465b71010df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,3 +26,4 @@ repos: hooks: - id: openapi-spec-validator files: .*openapi.*\.(json|yaml|yml) + exclude: ^(tests/|.github/workflows/)