diff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yaml index b72f73563..ba7a40e34 100644 --- a/.github/workflows/ci-server.yaml +++ b/.github/workflows/ci-server.yaml @@ -97,6 +97,19 @@ jobs: exit 1 fi + - name: GraphQL / Check for Pending Generation + if: steps.changed-files.outputs.any_changed == 'true' + run: | + GRAPHQL_GENERATE_OUTPUT=$(npx nx run twenty-front:graphql:generate || true) + GRAPHQL_METADATA_OUTPUT=$(npx nx run twenty-front:graphql:generate --configuration=metadata || true) + if [[ $GRAPHQL_GENERATE_OUTPUT == *"No changes detected"* && $GRAPHQL_METADATA_OUTPUT == *"No changes detected"* ]]; then + echo "GraphQL generation check passed." + else + echo "::error::Unexpected GraphQL changes detected. Please run the required commands and commit the changes." + echo "$GRAPHQL_GENERATE_OUTPUT" + echo "$GRAPHQL_METADATA_OUTPUT" + exit 1 + fi - name: Save server setup uses: ./.github/workflows/actions/save-cache with: