Skip to content

Commit

Permalink
chore: updates patterns to take a single input from the trestlebot CLI
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jul 5, 2023
1 parent 9cd4f19 commit ddd0ade
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
24 changes: 12 additions & 12 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ trap exec 3>&- EXIT

# Initialize the command variable
command="python3.8 -m trestlebot \
--markdown-path=${INPUT_MARKDOWN_PATH} \
--oscal-model=${INPUT_OSCAL_MODEL} \
--ssp-index-path=${INPUT_SSP_INDEX_PATH} \
--commit-message=${INPUT_COMMIT_MESSAGE} \
--branch=${INPUT_BRANCH} \
--patterns=${INPUT_FILE_PATTERN} \
--committer-name=${INPUT_COMMIT_USER_NAME} \
--committer-email=${INPUT_COMMIT_USER_EMAIL} \
--author-name=${INPUT_COMMIT_AUTHOR_NAME} \
--author-email=${INPUT_COMMIT_AUTHOR_EMAIL} \
--skip-items=${INPUT_SKIP_ITEMS} \
--working-dir=${INPUT_REPOSITORY}"
--markdown-path=\"${INPUT_MARKDOWN_PATH}\" \
--oscal-model=\"${INPUT_OSCAL_MODEL}\" \
--ssp-index-path=\"${INPUT_SSP_INDEX_PATH}\" \
--commit-message=\"${INPUT_COMMIT_MESSAGE}\" \
--branch=\"${INPUT_BRANCH}\" \
--file-pattern=\"${INPUT_FILE_PATTERN}\" \
--committer-name=\"${INPUT_COMMIT_USER_NAME}\" \
--committer-email=\"${INPUT_COMMIT_USER_EMAIL}\" \
--author-name=\"${INPUT_COMMIT_AUTHOR_NAME}\" \
--author-email=\"${INPUT_COMMIT_AUTHOR_EMAIL}\" \
--working-dir=\"${INPUT_REPOSITORY}\" \
--skip-items=\"${INPUT_SKIP_ITEMS}\""

# Conditionally include flags
if [[ ${INPUT_SKIP_ASSEMBLE} == true ]]; then
Expand Down
2 changes: 1 addition & 1 deletion tests/trestlebot/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def valid_args_dict() -> dict:
"committer-name": "test",
"committer-email": "[email protected]",
"working-dir": "tmp",
"patterns": ".",
"file-pattern": ".",
}


Expand Down
9 changes: 4 additions & 5 deletions trestlebot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ def _parse_cli_arguments() -> argparse.Namespace:
help="OSCAL model type to run tasks on. Values can be catalog, profile, compdef, or ssp",
)
parser.add_argument(
"--patterns",
nargs="+",
type=str,
"--file-pattern",
required=True,
help="List of file patterns to include in repository updates",
type=str,
help="File pattern to be used with `git add` in repository updates",
)
parser.add_argument(
"--skip-items",
Expand Down Expand Up @@ -211,7 +210,7 @@ def run() -> None:
author_name=args.author_name,
author_email=args.author_email,
pre_tasks=pre_tasks,
patterns=args.patterns,
patterns=[args.file_pattern],
check_only=args.check_only,
)

Expand Down

0 comments on commit ddd0ade

Please sign in to comment.