slack_notify_qa_risky.yml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 2020 The Actions Ecosystem Authors
  2. # Modifications Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Portions of this file are derived from the README examples in the Action
  16. # Slack Notifier project. The original source code was retrieved on
  17. # January 5, 2022 from:
  18. #
  19. # https://github.com/actions-ecosystem/action-slack-notifier/blob/fc778468d09c43a6f4d1b8cccaca59766656996a/README.md
  20. # Send a notification to the #team-testing-risky Slack channel when a risky change is made.
  21. name: Slack QA Risky Notifications
  22. on:
  23. pull_request_target:
  24. types:
  25. - opened
  26. - reopened
  27. - ready_for_review
  28. paths:
  29. - src/pgwire/src/message.rs
  30. - src/sql/src/plan/statement.rs
  31. - src/catalog/src/builtin.rs
  32. - src/sql/src/rbac.rs
  33. - src/sqllogictest/src/runner.rs
  34. - src/adapter/src/coord/command_handler.rs
  35. - src/expr/src/relation/mod.rs
  36. - src/adapter/src/coord.rs
  37. - src/sql-parser/src/ast/defs/statement.rs
  38. - src/adapter/src/catalog.rs
  39. - src/sql/src/catalog.rs
  40. - src/pgwire/src/protocol.rs
  41. - src/expr/src/scalar/mod.rs
  42. - src/adapter/src/coord/sequencer.rs
  43. - src/sql/src/func.rs
  44. - src/sql/src/plan.rs
  45. - src/adapter/src/coord/sequencer/inner.rs
  46. - src/expr/src/scalar/func.rs
  47. - src/sql/src/plan/statement/ddl.rs
  48. - src/adapter/src/catalog.rs
  49. - src/adapter/src/coord.rs
  50. - src/sql/src/plan/query.rs
  51. - src/sql-parser/src/parser.rs
  52. jobs:
  53. notify:
  54. name: "Notify about risky PRs"
  55. runs-on: ubuntu-latest
  56. if: ${{ !github.event.pull_request.draft }}
  57. steps:
  58. - name: Checkout
  59. uses: actions/checkout@v4
  60. with:
  61. fetch-depth: 1
  62. - name: "Long change filter"
  63. id: long
  64. run: |
  65. num_lines=$(git diff --diff-filter=AM ${{ github.event.pull_request.base.sha }} -- '*.rs' | grep "^+" | grep -v "^+++" | wc -l)
  66. if [[ $num_lines -gt 300 ]]; then
  67. echo "long=true" >> $GITHUB_OUTPUT
  68. fi
  69. - name: "Push to Slack"
  70. if: steps.long.outputs.long == 'true'
  71. uses: actions-ecosystem/action-slack-notifier@fc778468d09c43a6f4d1b8cccaca59766656996a
  72. with:
  73. slack_token: ${{ secrets.SLACK_TOKEN }}
  74. channel: team-testing-risky
  75. custom_payload: |
  76. {
  77. "blocks": [
  78. {
  79. "type": "section",
  80. "text": {
  81. "type": "mrkdwn",
  82. "text": "• <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>"
  83. }
  84. }
  85. ]
  86. }