-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
69 lines (61 loc) · 2.07 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: 'WebSentry Action'
description: 'Check the health of a website and report status'
inputs:
website-url:
description: 'The URL of the website to check (e.g., example.com)'
required: true
max-retries:
description: 'Maximum number of retries (default: 3)'
required: false
default: '3'
retry-interval:
description: 'Time to wait between retries in seconds (default: 5)'
required: false
default: '5s'
request-timeout:
description: 'Request timeout in seconds (default: 10)'
required: false
default: '10s'
ACCESS_TOKEN:
description: 'Access token to access the repo'
required: false
default: ''
branding:
icon: 'activity'
color: 'gray-dark'
outputs:
health-status:
description: 'The health status of the website (up or down)'
runs:
using: 'composite'
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16' # Use the Go version you need
- name: Run Check
run: go run ${{ github.action_path }}/main.go -site ${{ inputs.website-url }} -maxretries ${{ inputs.max-retries}} -retryinterval ${{ inputs.retry-interval }} -requesttimeout ${{ inputs.request-timeout}}
shell: bash
# - name: Commit PDF Report
# run: |
# echo ${{ inputs.ACCESS_TOKEN}}
# touch report.pdf
# git config --global user.email "[email protected]"
# git config --global user.name "GitHub Actions"
# git add report.pdf
# git commit -m "Add website health report"
# git push https://${{ inputs.ACCESS_TOKEN }}@github.com/${{ github.repository }} HEAD:main
# shell: bash
# - name: Deploy Documentation
# run: |
# git config --global user.name "GitHub Actions"
# git config --global user.email "[email protected]"
# git checkout -b action-test
# touch test.md
# git add .
# git commit -m "Auto-generate documentation"
# git push origin gh-pages
# env:
# GITHUB_TOKEN: ${{ inputs.ACCESS_TOKEN }}