From 619862acbedc29eb982f9e5d3ceabd1da7b58e23 Mon Sep 17 00:00:00 2001 From: Ian Bearman Date: Thu, 2 Nov 2023 16:12:50 -0700 Subject: [PATCH] update issue instead of creating a new one --- .github/workflows/nightly-tests.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index f6bd7567..bd618408 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -27,9 +27,20 @@ jobs: - name: Report Failure if: ${{ failure() }} run: | - gh --repo ${{ github.repository }} issue create \ - --title "Rolling Build Failure $(date +'%Y-%m-%d')" \ - --body "cc @microsoft/aifx-compilers - The rolling build has failed. See: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + issues=$(gh --repo microsoft/triton-shared issue list --label nightly-build-failure --state open) + build_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + notificiation_list="@microsoft/aifx-compilers" + if [ -z "$issues" ]; then + gh --repo ${{ github.repository }} issue create \ + --title "Nightly Build Failure $(date +'%Y-%m-%d')" \ + --label "nightly-build-failure" \ + --body "cc $notificiation_list + The nightly build has failed. See: $build_url" + else + issue_number=$(echo "$issues" | head -n 1 | awk '{print $1}') + gh --repo microsoft/triton-shared issue comment $issue_number \ + --body "cc $notificiation_list + The nightly build has failed again. See: $build_url" + fi env: GH_TOKEN: ${{ github.token }}