diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c099ef3..a4ff211 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,6 +86,6 @@ jobs: heroku_email: "nsakhilesh02@gmail.com" 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/ diff --git a/README.md b/README.md index 60f150f..1d1864c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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_ @@ -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 diff --git a/action.yml b/action.yml index 224b2b8..ad70d82 100644 --- a/action.yml +++ b/action.yml @@ -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: "" diff --git a/index.js b/index.js index db26e9e..e44d843 100644 --- a/index.js +++ b/index.js @@ -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"), }; @@ -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" );