Skip to content

Commit 51488a7

Browse files
ci: Open an issue if scheduled fails (#159)
1 parent f0b83ee commit 51488a7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@ jobs:
7373
- name: Generate and check project
7474
run: cargo ${{ env.TOOLCHAIN }} xtask check ${{ matrix.chip }} ${{ fromJSON('["", "--all-combinations"]')[inputs.all_combinations || github.event_name == 'schedule'] }} ${{ fromJSON('["", "--build"]')[inputs.build || github.event_name == 'schedule'] }}
7575

76+
- if: ${{ github.event_name == 'schedule' && failure() }}
77+
name: Create or Update GitHub Issue
78+
env:
79+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: |
81+
sudo apt-get install gh -y
82+
ISSUE_NAME=$(gh issue list --state open --search "Sheduled CI Failure in:title" --json number --jq '.[0].number')
83+
84+
if [[ -z "$ISSUE_NAME" ]];
85+
then
86+
gh issue create \
87+
--title "Sheduled CI Failure" \
88+
--body "Sheduled CI Workflow Failed! [View the failed job](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." \
89+
--label "all-combinations"
90+
fi
7691
# --------------------------------------------------------------------------
7792
# Test
7893

0 commit comments

Comments
 (0)