Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/upstream-dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
name: failure-issue
needs: [upstream-dev]
if: |
needs.upstream-dev.testresults != 'success'
needs.upstream-dev.outputs.testresults != 'success'
&& github.repository == 'UXARRAY/uxarray'
&& github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
Expand All @@ -84,13 +84,20 @@ jobs:
issue_body="${issue_body//\{\{RUN_URL\}\}/${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}}"
issue_body="${issue_body//\{\{DATE\}\}/$(date -u)}"

# Check for existing open issue with same title
issue_title="🤖 Upstream testing failure"
existing_issue=$(gh issue list --state open --label "CI" --search "\"$issue_title\" in:title" --json number --jq '.[0].number // empty')
# Prefix used for identity/matching; date suffix is for display only
title_prefix="🤖 Upstream testing failure"
issue_title="${title_prefix} ($(date -u +%Y-%m-%d))"

# Find existing open issue whose title starts with the fixed prefix
existing_issue=$(gh issue list --state open --label "CI" --json number,title \
--jq '.[] | select(.title | startswith("'"$title_prefix"'")) | .number' \
| head -n1)

if [ -n "$existing_issue" ]; then
echo "Found existing open issue #$existing_issue, updating it..."
echo "$issue_body" | gh issue edit "$existing_issue" --body-file -
echo "$issue_body" | gh issue edit "$existing_issue" \
--title "$issue_title" \
--body-file -
echo "Updated existing issue #$existing_issue"
else
echo "No existing open issue found, creating new one..."
Expand Down