From 4471295aa2b7f10e88c3742a41c947d9ad9f4cd2 Mon Sep 17 00:00:00 2001 From: Fabio Madge Date: Mon, 22 Jul 2024 16:53:08 +0200 Subject: [PATCH] chore: Try to update existing issues This automation creates a lot of noise on `dafny-lang/dafny`. Instead of always creating new issues, we create a comment, when possible. --- .github/workflows/nightly.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ed5b20ee6..f6ee50e28 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -90,8 +90,14 @@ jobs: env: GH_TOKEN: ${{ env.GITHUB_AWS_CRYPTO_TOOLS_CI_BOT_ESDK_RELEASE_TOKEN }} run: | - gh issue create \ - --repo "dafny-lang/dafny" \ - --title "[PRERELEASE REGRESSION] Dafny prerelease regression from ${{ github.repository }}" \ - --body "Failure in ${{ github.workflow_ref }}. \ - See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + id=$(gh search issues -R dafny-lang/dafny --match title "[PRERELEASE REGRESSION] Dafny prerelease regression from ${{ github.repository }}" --json number,state -q '[.[] | select( .state=="open" )][0].number') + if [ -n "$id" ]; then + gh issue comment -R dafny-lang/dafny $id \ + -b "Another failure in ${{ github.workflow_ref }}. \ + See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + else + gh issue create -R dafny-lang/dafny \ + -t "[PRERELEASE REGRESSION] Dafny prerelease regression from ${{ github.repository }}" \ + -b "Failure in ${{ github.workflow_ref }}. \ + See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + fi