slack_notify_labeled.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. # http://www.apache.org/licenses/LICENSE-2.0
  8. # Unless required by applicable law or agreed to in writing, software
  9. # distributed under the License is distributed on an "AS IS" BASIS,
  10. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. # See the License for the specific language governing permissions and
  12. # limitations under the License.
  13. # Portions of this file are derived from the README examples in the Action
  14. # Slack Notifier project. The original source code was retrieved on
  15. # January 5, 2022 from:
  16. # https://github.com/actions-ecosystem/action-slack-notifier/blob/fc778468d09c43a6f4d1b8cccaca59766656996a/README.md
  17. name: Slack Label Notifications
  18. on:
  19. pull_request:
  20. types:
  21. - labeled
  22. jobs:
  23. notify:
  24. runs-on: ubuntu-latest
  25. steps:
  26. - uses: actions-ecosystem/action-slack-notifier@fc778468d09c43a6f4d1b8cccaca59766656996a
  27. if: ${{ github.event.label.name == 'release-blocker' }}
  28. with:
  29. slack_token: ${{ secrets.SLACK_TOKEN }}
  30. channel: release
  31. message: |
  32. `${{ github.event.label.name }}` label has been added to "${{ github.event.pull_request.title }}" (${{ github.event.pull_request.html_url }}) (assigned to: ${{ github.event.pull_request.assignee.login || 'unassigned' }}).
  33. color: red
  34. verbose: false