-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1016 Bytes
/
on_push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Push
on:
push:
jobs:
failing-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Failing job
run: exit 1
create-issue:
runs-on: ubuntu-latest
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
needs: [ failing-job ]
steps:
- name: Check whether the issue already exists
id: check-issue
continue-on-error: true
run: |
if curl -L -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/$GITHUB_REPOSITORY/issues | grep "CI run failed"; then
echo ISSUE_EXISTS="True" >> $GITHUB_OUTPUT
else
echo ISSUE_EXISTS="False" >> $GITHUB_OUTPUT
fi
- name: Create issue
if: ${{ equals(steps.check-issue.outputs.ISSUE_EXISTS, "False") }}
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: CI run failed
body: my new issue