Skip to content

Commit

Permalink
action.yml updated
Browse files Browse the repository at this point in the history
  • Loading branch information
theritikchoure committed Oct 29, 2023
1 parent 6a81c79 commit 911b893
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/website_health.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: Check Website Health
name: Website Health Check

on:
schedule:
- cron: "*/10 * * * *"
- cron: '*/5 * * * *' # Run every 5 minutes (adjust the cron schedule as needed)

jobs:
check-website-health:
health-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.x

- name: Check Website Health
run: go run main.go --site docfliq.com --maxretries 6
uses: theritikchoure/[email protected]
with:
website-url: 'https://example.com'
max-retries: 3
retry-interval: 5
request-timeout: 10
39 changes: 22 additions & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,31 @@ inputs:
description: 'Time to wait between retries in seconds (default: 5)'
required: false
default: '5'
request-timeout:
description: 'Request timeout in seconds (default: 10)'
required: false
default: '10'

branding:
icon: 'activity'
color: 'gray-dark'

outputs:
health-status:
description: 'The health status of the website (up or down)'

runs:
using: 'composite'
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16' # Use the Go version you need

- name: Check out code
uses: actions/checkout@v2

- name: Run Websentry
run: go run main.go --site ${{ inputs.website-url }} --maxretries ${{ inputs.max-retries }} --retryinterval ${{ inputs.retry-interval }} --requesttimeout ${{ inputs.request-timeout }}

branding:
icon: 'activity'
color: 'gray-dark'

using: 'docker'
image: 'docker://golang:1.16'
args:
- /bin/sh
- -c
- |
go get -u github.com/theritikchoure/logx
go build -o /github/workspace/websentry main.go
chmod +x /github/workspace/websentry
/github/workspace/websentry \
-site ${{ inputs.website-url }} \
-maxretries ${{ inputs.max-retries }} \
-retryinterval ${{ inputs.retry-interval }} \
-requesttimeout ${{ inputs.request-timeout }}

0 comments on commit 911b893

Please sign in to comment.