Skip to content

Commit

Permalink
Add verbose option to action (#82)
Browse files Browse the repository at this point in the history
* Adjusting GitHub Action to add 'verbose' option
* Bump Dockerfile version
* Update README to include
  • Loading branch information
mrmundt committed Dec 8, 2021
1 parent 6e6b004 commit 34deb4c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/urlstechie/urlchecker:0.0.23
FROM quay.io/urlstechie/urlchecker:0.0.25
COPY entrypoint.sh /entrypoint.sh
WORKDIR /github/workspace
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ jobs:
# Choose whether to include file with no URLs in the prints.
print_all: false
# Choose whether to print a more verbose end summary with files and broken URLs.
verbose: true
# The timeout seconds to provide to requests, defaults to 5 seconds
timeout: 5
Expand All @@ -120,22 +123,23 @@ jobs:
## Inputs


| variable name | variable type | variable description |
|-----------------------------|----------------------------------------------|------------------------------------------------------------------|
| `git_path` | <span style="color:green"> optional </span> | A git url to clone, if the repository isn't already in $PWD |
| `branch` | <span style="color:green"> optional </span> | If we do a clone, clone this branch (defaults to master |
| `cleanup` | <span style="color:green"> optional </span> | If we do a clone, delete the cloned folder after (false) |
| `subfolder` | <span style="color:green"> optional </span> | A subfolder to navigate to in the repository to check |
| `file_types` | <span style="color:green"> optional </span> | A comma-separated list of file types to cover in the URLs checks.|
| `include_files` | <span style="color:green"> optional </span> | A comma-separated list of exact files to check. |
| `print_all` | <span style="color:green"> optional </span> | Choose whether to include file with no URLs in the prints. |
| `retry_count` | <span style="color:green"> optional </span> | If a request fails, retry this number of times. Defaults to 1 |
| `save` | <span style="color:green"> optional </span> | A path to a csv file to save results to |
| `timeout` | <span style="color:green"> optional </span> | The timeout to provide to requests to wait for a response. |
| `exclude_urls` | <span style="color:green"> optional </span> | A comma separated list of links. |
| `exclude_patterns` | <span style="color:green"> optional </span> | A comma separated list of patterns. |
| `exclude_files` | <span style="color:green"> optional </span> | Full paths to files to exclude (comma separated list). |
| `force_pass` | <span style="color:green"> optional </span> | Choose whether to force a pass when checks are done. |
| variable name | variable type | variable description |
|-----------------------------|----------------------------------------------|--------------------------------------------------------------------------------|
| `git_path` | <span style="color:green"> optional </span> | A git url to clone, if the repository isn't already in $PWD |
| `branch` | <span style="color:green"> optional </span> | If we do a clone, clone this branch (defaults to master |
| `cleanup` | <span style="color:green"> optional </span> | If we do a clone, delete the cloned folder after (false) |
| `subfolder` | <span style="color:green"> optional </span> | A subfolder to navigate to in the repository to check |
| `file_types` | <span style="color:green"> optional </span> | A comma-separated list of file types to cover in the URLs checks. |
| `include_files` | <span style="color:green"> optional </span> | A comma-separated list of exact files to check. |
| `print_all` | <span style="color:green"> optional </span> | Choose whether to include file with no URLs in the prints. |
| `verbose` | <span style="color:green"> optional </span> | Choose whether to print a more verbose end summary with files and broken URLs |
| `retry_count` | <span style="color:green"> optional </span> | If a request fails, retry this number of times. Defaults to 1 |
| `save` | <span style="color:green"> optional </span> | A path to a csv file to save results to |
| `timeout` | <span style="color:green"> optional </span> | The timeout to provide to requests to wait for a response. |
| `exclude_urls` | <span style="color:green"> optional </span> | A comma separated list of links. |
| `exclude_patterns` | <span style="color:green"> optional </span> | A comma separated list of patterns. |
| `exclude_files` | <span style="color:green"> optional </span> | Full paths to files to exclude (comma separated list). |
| `force_pass` | <span style="color:green"> optional </span> | Choose whether to force a pass when checks are done. |

## Demo
- Using version > 0.1.4
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ inputs:
required: false
default: false

verbose:
description: "Choose whether to print a more verbose end summary with files and broken URLs."
required: false
default: false

retry_count:
description: "If a request fails, retry this number of times. Defaults to 1"
required: false
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ if [ "${INPUT_PRINT_ALL}" == "false" ]; then
echo "Automated PR requested"
fi

# verbose defaults to false
if [ "${INPUT_VERBOSE}" == "true" ]; then
COMMAND="${COMMAND} --verbose"
fi

# file types are optional
if [ ! -z "${INPUT_FILE_TYPES}" ]; then
COMMAND="${COMMAND} --file-types ${INPUT_FILE_TYPES}"
Expand Down

0 comments on commit 34deb4c

Please sign in to comment.