Skip to content

Commit

Permalink
Create an issue when nightly-ci fails (#3080)
Browse files Browse the repository at this point in the history
* Create an issue when nightly-ci fails

* cleanup

* Use GitHub CLI instead of action, link failed job
  • Loading branch information
JurajSadel authored Feb 3, 2025
1 parent 9ff40f9 commit 8ba212c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 8ba212c

Please sign in to comment.