This GitHub Action creates an issue or comments on an existing issue if a workflow run fails. It picks the latest created issue with the given label to comment.
GITHUB_TOKEN
(required): The GitHub token for authentication.title
(required): The title of the issue to create or update.body
(required): The body of the issue to create or update.label
(required): The label to add to the issue. Used to identify the issue.
issue-number
: The issue number if an issue was found or created.
Here is an example of how to use this action in your workflow:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Add your build steps here
- name: Create issue on failure
if: failure()
uses: ipdxco/create-or-update-issue
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: 'Build failed'
body: 'The build has failed. Please check the details and fix the issue.'
label: 'build-failure'