Skip to content

Commit e9ab38c

Browse files
committed
ci
1 parent aaec1ab commit e9ab38c

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI Failure Issue
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- github pages
7+
types: [completed]
8+
9+
jobs:
10+
notify:
11+
if: contains(fromJSON('["failure","timed_out","action_required"]'), github.event.workflow_run.conclusion)
12+
permissions:
13+
issues: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Create failure issue
17+
env:
18+
GH_TOKEN: ${{ github.token }}
19+
REPOSITORY: ${{ github.repository }}
20+
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
21+
CONCLUSION: ${{ github.event.workflow_run.conclusion }}
22+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
23+
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
24+
ACTOR: ${{ github.event.workflow_run.actor.login }}
25+
RUN_URL: ${{ github.event.workflow_run.html_url }}
26+
run: |
27+
body_file="$(mktemp)"
28+
cat > "$body_file" <<EOF
29+
@sunnylqm CI run failed.
30+
31+
Repository: $REPOSITORY
32+
Workflow: $WORKFLOW_NAME
33+
Conclusion: $CONCLUSION
34+
Branch: $HEAD_BRANCH
35+
Commit: $HEAD_SHA
36+
Actor: $ACTOR
37+
Run: $RUN_URL
38+
EOF
39+
40+
gh issue create \
41+
--repo "$REPOSITORY" \
42+
--title "[CI failed] $REPOSITORY / $WORKFLOW_NAME" \
43+
--body-file "$body_file"

0 commit comments

Comments
 (0)