Skip to content

Commit 70c0d14

Browse files
authored
chore: Try to update existing issues (#661)
This automation creates a lot of noise on dafny-lang/dafny. Instead of always creating new issues, we create a comment, when possible. Same as #660, but from this repo.
1 parent 9c73845 commit 70c0d14

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/nighly_dafny.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ jobs:
6363
env:
6464
GH_TOKEN: ${{ env.GITHUB_AWS_CRYPTO_TOOLS_CI_BOT_ESDK_RELEASE_TOKEN }}
6565
run: |
66-
gh issue create \
67-
--repo "dafny-lang/dafny" \
68-
--title "[PRERELEASE REGRESSION] Dafny prerelease regression from ${{ github.repository }}" \
69-
--body "Failure in ${{ github.workflow_ref }}. \
70-
See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
71-
66+
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')
67+
if [ -n "$id" ]; then
68+
gh issue comment -R dafny-lang/dafny $id \
69+
-b "Another failure in ${{ github.workflow_ref }}. \
70+
See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
71+
else
72+
gh issue create -R dafny-lang/dafny \
73+
-t "[PRERELEASE REGRESSION] Dafny prerelease regression from ${{ github.repository }}" \
74+
-b "Failure in ${{ github.workflow_ref }}. \
75+
See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
76+
fi

0 commit comments

Comments
 (0)