Giter Club home page Giter Club logo

gh-action-url-health-check's Introduction

URL Health Check GitHub Action

This GitHub Action monitors the health of a specified URL and takes automated actions if the health check fails. It performs the following tasks:

  1. Checks the specified URL to see if it's reachable and returns a status code.
  2. Captures a screenshot of the URL when the health check fails.
  3. Creates a GitHub issue with information about the failed URL, status code, and a link to the captured screenshot.

Usage

As a reusable workflow

name: URL Health Cheack
on:
  workflow_dispatch:
    inputs:
      url:
        description: 'URL to check'
        required: false
        default: 'https://example.com'
jobs:
  url_to_check:
     uses: appatalks/GH-Action-URL-Health-Check/.github/workflows/healthcheck.yml@main
     with:
       url: ${{ inputs.url }}

Clone and Roll your own

To use this GitHub Action, follow these steps:

  1. Add the Workflow File

    Create a .github/workflows/healthcheck.yml file in your repository with the following content:

    You can copy the example workflow file from the GitHub repository here.

    Make sure to configure the URL you want to check by editing the default value or providing it when manually triggering the workflow.

  2. Add the healthcheck.js File

    Copy the healthcheck.js file to the root of your repository, or modify the yml file accordingly for a new path.

  3. Run the Workflow

    Trigger the workflow manually via the GitHub Actions UI or set up a schedule for it to run periodically.

  4. Review Results

    If the health check fails (returns a status code other than 200), the workflow will:

    • Capture a screenshot of the URL.
    • Create a GitHub issue with details about the failure, including the status code and screenshot of the URL.

    You can then investigate and resolve the issue accordingly.

That's it! You now have an automated URL health monitoring system in place using GitHub Actions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.