diff --git a/.github/workflows/workflow-build-and-test.yml b/.github/workflows/workflow-build-and-test.yml index 44f343145..c4d646cc9 100644 --- a/.github/workflows/workflow-build-and-test.yml +++ b/.github/workflows/workflow-build-and-test.yml @@ -5,6 +5,27 @@ on: workflow_call: jobs: + check-for-changes: + name: Check for changes + uses: ./.github/workflows/workflow-check-for-changes.yml + + check-refitter-swagger-sync: + needs: [ check-for-changes ] + if: ${{ needs.check-for-changes.outputs.hasSwaggerSchemaChanges == 'true' && needs.check-for-changes.outputs.hasWebApiClientRefitterInterfaceChanges != 'true' }} + runs-on: ubuntu-latest + name: Check refitter swagger sync + steps: + - uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🤖 The OpenAPI spec has changed, but the WebAPI Refitter interface has not.\n\nDid you forget to rebuild the WebAPI SDK?\nIf not, carry on! 🚀' + }) + build-and-test: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/workflow-check-for-changes.yml b/.github/workflows/workflow-check-for-changes.yml index dcbf6e31b..056933918 100644 --- a/.github/workflows/workflow-check-for-changes.yml +++ b/.github/workflows/workflow-check-for-changes.yml @@ -23,6 +23,9 @@ on: hasWebApiClientChanges: description: "WebApiClient related files changed" value: ${{ jobs.check-for-changes.outputs.hasWebApiClientChanges }} + hasWebApiClientRefitterInterfaceChanges: + description: "Refitter interface changed" + value: ${{ jobs.check-for-changes.outputs.hasWebApiClientRefitterInterfaceChanges }} hasTestChanges: description: "Test related files changed" value: ${{ jobs.check-for-changes.outputs.hasTestChanges }} @@ -51,6 +54,7 @@ jobs: hasSwaggerSchemaChanges: ${{ steps.filter-backend.outputs.swagger_schema_any_modified == 'true'}} hasGqlSchemaChanges: ${{ steps.filter-backend.outputs.gql_schema_any_modified == 'true'}} hasMigrationChanges: ${{ steps.filter-backend.outputs.migration_any_modified == 'true'}} + hasWebApiClientRefitterInterfaceChanges: ${{ steps.filter-backend.outputs.web_api_client_refitter_interface_any_modified == 'true'}} hasWebApiClientChanges: ${{ steps.filter-backend.outputs.web_api_client_any_modified == 'true'}} steps: - name: Checkout @@ -83,6 +87,8 @@ jobs: - '.azure/modules/containerApp/**/*' tests: - 'tests/**/*' + web_api_client_refitter_interface: + - 'src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.cs' web_api_client: - 'src/Digdir.Library.Dialogporten.WebApiClient/**/*' swagger_schema: