Skip to content

Creates an issue or comments on an existing issue if a workflow run fails.

Notifications You must be signed in to change notification settings

ipdxco/create-or-update-issue

Repository files navigation

Create Or Update Issue

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.

Inputs

  • 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.

Outputs

  • issue-number: The issue number if an issue was found or created.

Usage

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'

About

Creates an issue or comments on an existing issue if a workflow run fails.

Resources

Stars

Watchers

Forks

Packages

No packages published