Skip to content

Commit

Permalink
automating creating issues
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledyoussef24 committed Jun 3, 2024
1 parent abf4180 commit f05986b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/nightly_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The following test(s) have failed:
28 changes: 25 additions & 3 deletions .github/workflows/grid_client_nightly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This workflow will install needed dependencies and run main grid tests.

name: Grid Client Nightly

on:
Expand Down Expand Up @@ -42,7 +40,7 @@ jobs:
node-version: 18
cache: "yarn"

- name: Install deps
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git libtool tmux redis net-tools
Expand Down Expand Up @@ -123,6 +121,7 @@ jobs:
echo Delete all contracts: ${{ steps.deleteall.outcome }}
- name: Check test script status
id: check-status
if: |
steps.dynamicsinglevm.outcome != 'success' ||
steps.multiplevm.outcome != 'success' ||
Expand All @@ -133,3 +132,26 @@ jobs:
steps.zdb.outcome != 'success' ||
steps.deleteall.outcome != 'success'
run: exit 1

- name: Set up GitHub CLI
uses: actions/setup-gh@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install jq
run: sudo apt-get install -y jq

- name: Check for existing issues
if: failure()
id: check-issues
run: |
existing_issue=$(gh issue list --state open --label bug --json title | jq -r '.[] | select(.title == "Test Failure Detected")')
echo "existing_issue=${existing_issue}" >> $GITHUB_ENV
- name: Create GitHub Issue on Failure
if: failure() && env.existing_issue == ''
uses: peter-evans/create-issue-from-file@v4
with:
title: "Test Failure Detected"
content-file: ./.github/ISSUE_TEMPLATE/nightly_report.yml
labels: bug

0 comments on commit f05986b

Please sign in to comment.