Skip to content

Commit

Permalink
removed capitalization from checkstring
Browse files Browse the repository at this point in the history
  • Loading branch information
AkhileshNS committed Jul 8, 2020
1 parent 884a595 commit 338817d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ jobs:
heroku_email: "[email protected]"
appdir: "tests/test-4"
healthcheck: "https://akhileshns-hd-test-4.herokuapp.com/health"
checkString: "ok"
checkstring: "ok"
procfile: "web: gunicorn index:app"
- run: npm run test-action https://akhileshns-hd-test-4.herokuapp.com/
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The action comes with additional options that you can use to configure your proj
| docker_heroku_process_type | false | Type of heroku process (web, worker, etc). This option only makes sense when usedocker enabled. Defaults to "web" (Thanks to [singleton11](https://github.com/singleton11) for adding this feature) | web, worker |
| appdir | false | Set if your app is located in a subdirectory | api, apis/python |
| healthcheck | false | A URL to which a healthcheck is performed (checks for 200 request) | https://demo-rest-api.herokuapp.com |
| checkstring | false | Value to check for when conducting healthcheck requests | ok |
| procfile | false | Contents of the Procfile to save and deploy | web: npm start |
## Examples
Expand Down Expand Up @@ -229,7 +230,7 @@ P.S: It is recommended that you setup a specific route such as **/health** for p

### Advanced Usage

Additionally, if you are using a custom route for performing healthchecks, you can check for a specific value from this url using the **checkString** option of the action like so:
Additionally, if you are using a custom route for performing healthchecks, you can check for a specific value from this url using the **checkstring** option of the action like so:

_.github/workflows/main.yml_

Expand All @@ -252,10 +253,10 @@ jobs:
heroku_app_name: "YOUR APP's NAME" #Must be unique in Heroku
heroku_email: "YOUR EMAIL"
healthcheck: "https://[YOUR APP's NAME].herokuapp.com/health"
checkString: "ok"
checkstring: "ok"
```

This will essentially check if the value returned by sending a GET request to the **healthcheck** url is equal to the **checkString**
This will essentially check if the value returned by sending a GET request to the **healthcheck** url is equal to the **checkstring**

## Environment Variables

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
description: "A URL to which a healthcheck is performed (checks for 200 request)"
required: false
default: ""
checkString:
checkstring:
description: "Value to check for when conducting healthcheck request"
required: false
default: ""
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ let heroku = {
dockerHerokuProcessType: core.getInput("docker_heroku_process_type"),
appdir: core.getInput("appdir"),
healthcheck: core.getInput("healthcheck"),
checkString: core.getInput("checkString"),
checkstring: core.getInput("checkstring"),
procfile: core.getInput("procfile"),
};

Expand Down Expand Up @@ -148,7 +148,7 @@ if (heroku.appdir) {
if (heroku.healthcheck) {
try {
const res = await p(heroku.healthcheck);
if (heroku.checkString && heroku.checkString !== res.body.toString()) {
if (heroku.checkstring && heroku.checkstring !== res.body.toString()) {
core.setFailed(
"Health Check Failed. Error deploying Server. Please check your logs on Heroku to try and diagnose the problem"
);
Expand Down

0 comments on commit 338817d

Please sign in to comment.