Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debugging logs #21

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Created by https://www.gitignore.io/api/linux,macos,windows,visualstudiocode
# Edit at https://www.gitignore.io/?templates=linux,macos,windows,visualstudiocode
.vscode

### Linux ###
*~
Expand Down
10 changes: 10 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def print_action_error(msg: str):
print(f'::error file={__name__}::{msg}')


def print_action_debug(msg: str):
print(f'::debug::{msg}')


def get_action_input(
name: str, required: bool = False, default: Optional[str] = None
) -> str:
Expand Down Expand Up @@ -51,12 +55,18 @@ def to_outputs(results: List[str]) -> Dict[str, str]:

def main():
msg = get_action_input('msg', required=True)
print_action_debug(f'msg: {msg}')
separator = get_action_input('separator', required=False, default=' ')
print_action_debug(f'separator: {separator}')
maxsplit = int(get_action_input('maxsplit', required=False, default='-1'))
print_action_debug(f'maxsplit: {maxsplit}')

results = split(msg, separator, maxsplit)
print_action_debug(f'results: {results}')
outputs = to_outputs(results)
print_action_debug(f'outputs: {outputs}')
for k, v in outputs.items():
print_action_debug(f'k: {k}, v: {v}')
set_action_output(k, v)


Expand Down