From b2ca93b620e83d01cd46df77de57bde1db77b025 Mon Sep 17 00:00:00 2001 From: Philipp Geier Date: Fri, 17 May 2024 12:22:34 +0200 Subject: [PATCH] Add notifications to github workflows --- .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/notify-new-issue.yml | 15 +++++++++++++++ .github/workflows/notify-new-pr.yml | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .github/workflows/notify-new-issue.yml create mode 100644 .github/workflows/notify-new-pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28bd7a5c4..1f03d50af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,3 +73,20 @@ jobs: repository: private-downstream-ci event_type: downstream-ci-hpc payload: '{"atlas": "ecmwf/atlas@${{ github.event.pull_request.head.sha || github.sha }}"}' + + + notify: + runs-on: ubuntu-latest + needs: + - downstream-ci + - private-downstream-ci + - downstream-ci-hpc + - private-downstream-ci-hpc + if: always() && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + steps: + - name: Trigger Teams notification + uses: ecmwf-actions/notify-teams@v1 + with: + incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} + needs_context: ${{ toJSON(needs) }} + diff --git a/.github/workflows/notify-new-issue.yml b/.github/workflows/notify-new-issue.yml new file mode 100644 index 000000000..384a35706 --- /dev/null +++ b/.github/workflows/notify-new-issue.yml @@ -0,0 +1,15 @@ +name: Notify new issue + +on: + issues: + types: + - "opened" + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Notify new issue + uses: ecmwf-actions/notify-teams-issue@v1 + with: + incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} diff --git a/.github/workflows/notify-new-pr.yml b/.github/workflows/notify-new-pr.yml new file mode 100644 index 000000000..6ed1a93ee --- /dev/null +++ b/.github/workflows/notify-new-pr.yml @@ -0,0 +1,16 @@ +name: Notify new PR + +# Needs the worklow to be located in the branche the PR is merged to +on: + pull_request_target: + types: + - "opened" + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Notify new PR + uses: ecmwf-actions/notify-teams-pr@v1 + with: + incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}