Skip to content

Commit

Permalink
Merge pull request #1 from sisodiya2421/sisodiya2421-patch-1
Browse files Browse the repository at this point in the history
Update entrypoint.sh and README.md
  • Loading branch information
sisodiya2421 authored Sep 10, 2020
2 parents 08e0d57 + 7b3716f commit 9caeec8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Scheduled Ping

This action pings your specified url every 25 minutes(changeable)
This action pings your specified URL every 30 minutes(**changeable**) and generates timing details using [cURL](https://curl.haxx.se/).

## Secrets

Expand All @@ -17,12 +17,12 @@ to get details about adding secrets to your repository

```yml
name: Scheduled Ping
# This workflow is triggered at a scheduled interval of every 25 minutes
# This workflow is triggered at a scheduled interval of every 30 minutes
on:
schedule:
# * is a special character in YAML so you have to quote this string.
# /25 denotes that it will run once every 25 minutes
- cron: '*/25 * * * *'
# /30 denotes that it will run once every 30 minutes
- cron: '*/30 * * * *'

jobs:
pinger_job:
Expand All @@ -35,8 +35,8 @@ jobs:
uses: sisodiya2421/pinger@master
```
**NOTE** You can change the time interval according to your own need. *Default is 25 minutes*. All you
need to do is just replace `'*/25 * * * *'` in line `- cron: '*/25 * * * *'` with your suitable timing.
**NOTE** You can change the time interval according to your own need. *Default is 30 minutes*. All you
need to do is just replace `'*/30 * * * *'` in line `- cron: '*/30 * * * *'` with your suitable timing.
Remember the shortest interval you can run scheduled workflows is once every 5 minutes.

### Some patterns for help
Expand Down
12 changes: 11 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@

# will throw error if variable is unset
set -eu

# curl command to ping the url specified in github secrets
curl -i --head $URL
curl -w @- -o /dev/null -s "$URL" <<'EOF'
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
EOF

0 comments on commit 9caeec8

Please sign in to comment.