Skip to content

Commit 911b893

Browse files
action.yml updated
1 parent 6a81c79 commit 911b893

File tree

2 files changed

+31
-30
lines changed

2 files changed

+31
-30
lines changed

.github/workflows/website_health.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
name: Check Website Health
1+
name: Website Health Check
22

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

77
jobs:
8-
check-website-health:
8+
health-check:
99
runs-on: ubuntu-latest
10-
1110
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v2
14-
15-
- name: Set up Go
16-
uses: actions/setup-go@v2
17-
with:
18-
go-version: 1.x
19-
2011
- name: Check Website Health
21-
run: go run main.go --site docfliq.com --maxretries 6
12+
uses: theritikchoure/[email protected]
13+
with:
14+
website-url: 'https://example.com'
15+
max-retries: 3
16+
retry-interval: 5
17+
request-timeout: 10

action.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,31 @@ inputs:
1313
description: 'Time to wait between retries in seconds (default: 5)'
1414
required: false
1515
default: '5'
16+
request-timeout:
17+
description: 'Request timeout in seconds (default: 10)'
18+
required: false
19+
default: '10'
20+
21+
branding:
22+
icon: 'activity'
23+
color: 'gray-dark'
1624

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

2129
runs:
22-
using: 'composite'
23-
steps:
24-
- name: Setup Go
25-
uses: actions/setup-go@v2
26-
with:
27-
go-version: '1.16' # Use the Go version you need
28-
29-
- name: Check out code
30-
uses: actions/checkout@v2
31-
32-
- name: Run Websentry
33-
run: go run main.go --site ${{ inputs.website-url }} --maxretries ${{ inputs.max-retries }} --retryinterval ${{ inputs.retry-interval }} --requesttimeout ${{ inputs.request-timeout }}
34-
35-
branding:
36-
icon: 'activity'
37-
color: 'gray-dark'
38-
30+
using: 'docker'
31+
image: 'docker://golang:1.16'
32+
args:
33+
- /bin/sh
34+
- -c
35+
- |
36+
go get -u github.com/theritikchoure/logx
37+
go build -o /github/workspace/websentry main.go
38+
chmod +x /github/workspace/websentry
39+
/github/workspace/websentry \
40+
-site ${{ inputs.website-url }} \
41+
-maxretries ${{ inputs.max-retries }} \
42+
-retryinterval ${{ inputs.retry-interval }} \
43+
-requesttimeout ${{ inputs.request-timeout }}

0 commit comments

Comments
 (0)