diff --git a/README.md b/README.md index 95820e5..65e6b0c 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ jobs: | pr_title | Title of the Pull Request | no¹ | | pr_source | Source branch for the Pull Request | no¹ | | pull_request_payload | PR payload in JSON format² | no³ | +| debug | set to "true" to turn on debug logging | no | +| dry_run | set to "true" to not send the webhook request | no | 1) The Action will determine whether to send an embed tailored towards a Pull Request Check Run or towards a general workflow run based on the presence of non-null values for the four pull request arguments. This means that you either have to provide **all** of them or **none** of them. diff --git a/action.yaml b/action.yaml index a1995d3..f1afb00 100644 --- a/action.yaml +++ b/action.yaml @@ -63,6 +63,16 @@ inputs: description: 'Pull Request in jSON payload form' required: false + debug: + description: 'Pull Request in jSON payload form' + required: false + default: 'false' + + dry_run: + description: 'Pull Request in jSON payload form' + required: false + default: 'false' + runs: using: 'docker' image: 'Dockerfile' @@ -82,6 +92,9 @@ runs: - ${{ inputs.pr_number }} - ${{ inputs.pr_title }} - ${{ inputs.pr_source }} + - ${{ inputs.pull_request_payload }} + - ${{ inputs.debug }} + - ${{ inputs.dry_run }} branding: icon: 'check-circle' diff --git a/github_status_embed/__main__.py b/github_status_embed/__main__.py index ea9552e..a22868e 100644 --- a/github_status_embed/__main__.py +++ b/github_status_embed/__main__.py @@ -45,24 +45,11 @@ for argument, configuration in action_specs["inputs"].items(): parser.add_argument(argument, help=configuration["description"]) -parser.add_argument( - "--debug", - help="enable debug logging", - action="store_true", - dest="debug", -) -parser.add_argument( - "--dry-run", - help="do not send webhook request", - action="store_true", - dest="dry_run" -) - if __name__ == "__main__": arguments = vars(parser.parse_args()) - debug = arguments.pop('debug') - dry_run = arguments.pop('dry_run') + debug = arguments.pop('debug') not in ('', '0', 'false') + dry_run = arguments.pop('dry_run') not in ('', '0', 'false') # Set up logging and make sure to mask the webhook_token in log records level = logging.DEBUG if debug else logging.WARNING