Get issues #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") }} | ||
Check failure on line 30 in .github/workflows/on_push.yaml GitHub Actions / PushInvalid workflow file
|
||
uses: dacbd/create-issue-action@main | ||
with: | ||
token: ${{ github.token }} | ||
title: CI run failed | ||
body: my new issue |