From 8ba212c7172f2874c4584717a7ecf5afd8addf4e Mon Sep 17 00:00:00 2001 From: Juraj Sadel Date: Mon, 3 Feb 2025 12:51:12 +0100 Subject: [PATCH] Create an issue when nightly-ci fails (#3080) * Create an issue when nightly-ci fails * cleanup * Use GitHub CLI instead of action, link failed job --- .github/workflows/ci_nightly.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci_nightly.yml b/.github/workflows/ci_nightly.yml index 2d66cde2f9d..b2276559ef3 100644 --- a/.github/workflows/ci_nightly.yml +++ b/.github/workflows/ci_nightly.yml @@ -51,3 +51,21 @@ jobs: device: ${{ matrix.device.soc }} target: ${{ matrix.device.target }} toolchain: nightly + + - name: Create or Update GitHub Issue + if: failure() + run: | + sudo apt-get install gh -y + ISSUE_NAME=$(gh issue list --state open --search "Nightly CI Failure in:title" --json number --jq '.[0].number') + + if [[ -n "$ISSUE_NAME" ]]; then + gh issue comment "$ISSUE_NAME" \ + --body "Another CI failure detected! [View the failed job](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." + else + gh issue create \ + --title "Nightly CI Failure" \ + --body "Nightly CI Workflow Failed! [View the failed job](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." \ + --label "ci-nightly" + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}