Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Health Check Action

A tiny GitHub Action that requests a URL and fails the job if it doesn't return the status you expect. Handy right after a deploy to confirm your app actually came up.

No dependencies — just Node's built-in fetch. Nothing to install or bundle.

Inputs

Input Required Default What it does
url yes https://example.com The URL to check.
expected-status no 200 The status code that means healthy.
timeout-ms no 5000 Give up after this many milliseconds.

Outputs

Output What it is
status The HTTP status code that came back.
duration-ms How long the request took, in ms.

Use it

Check your own app after a deploy:

- name: Check the site is up
  uses: knjoroge/js-action@v2
  with:
    url: 'https://your-app.com/health'
    expected-status: '200'

Read an output in a later step:

- name: Health check
  id: health
  uses: knjoroge/js-action@v2
  with:
    url: 'https://your-app.com/health'

- name: Show the result
  run: echo "Got ${{ steps.health.outputs.status }} in ${{ steps.health.outputs.duration-ms }}ms"

Develop

npm test   # runs the tests (Node's built-in test runner, no installs)

About

Github Action test

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages