diff --git a/actions/autosync/README.md b/actions/autosync/README.md index 546f7e58..187d6f1e 100644 --- a/actions/autosync/README.md +++ b/actions/autosync/README.md @@ -27,6 +27,7 @@ name: Example Workflow | oscal_model | OSCAL Model type to assemble. Values can be catalog, profile, compdef, or ssp. | None | True | | check_only | Runs tasks and exits with an error if there is a diff. Defaults to false | false | False | | github_token | GitHub token used to make authenticated API requests | None | False | +| version | Version of the OSCAL model to set during assembly into JSON. | 1.0.0 | False | | skip_assemble | Skip assembly task. Defaults to false | false | False | | skip_regenerate | Skip regenerate task. Defaults to false. | false | False | | skip_items | Comma-separated glob patterns list of content by trestle name to skip during task execution. For example `profile_x,profile_y*,`. | None | False | diff --git a/actions/autosync/action.yml b/actions/autosync/action.yml index aff7384a..a96616db 100644 --- a/actions/autosync/action.yml +++ b/actions/autosync/action.yml @@ -16,6 +16,10 @@ inputs: github_token: description: "GitHub token used to make authenticated API requests" required: false + version: + description: "Version of the OSCAL model to set during assembly into JSON." + required: false + default: "1.0.0" skip_assemble: description: "Skip assembly task. Defaults to false" required: false diff --git a/actions/autosync/auto-sync-entrypoint.sh b/actions/autosync/auto-sync-entrypoint.sh index ba03a2d3..f4731450 100644 --- a/actions/autosync/auto-sync-entrypoint.sh +++ b/actions/autosync/auto-sync-entrypoint.sh @@ -22,7 +22,8 @@ command="trestlebot-autosync \ --author-email=\"${INPUT_COMMIT_AUTHOR_EMAIL}\" \ --working-dir=\"${INPUT_REPOSITORY}\" \ --target-branch=\"${INPUT_TARGET_BRANCH}\" \ - --skip-items=\"${INPUT_SKIP_ITEMS}\"" + --skip-items=\"${INPUT_SKIP_ITEMS}\" \ + --version=\"${INPUT_VERSION}\"" # Conditionally include flags if [[ ${INPUT_SKIP_ASSEMBLE} == true ]]; then diff --git a/tests/trestlebot/entrypoints/test_autosync.py b/tests/trestlebot/entrypoints/test_autosync.py index 911cab8e..81f429bb 100644 --- a/tests/trestlebot/entrypoints/test_autosync.py +++ b/tests/trestlebot/entrypoints/test_autosync.py @@ -27,6 +27,7 @@ def valid_args_dict() -> Dict[str, str]: "committer-email": "test@email.com", "working-dir": ".", "file-patterns": ".", + "version": "0.1.0", } diff --git a/trestlebot/entrypoints/autosync.py b/trestlebot/entrypoints/autosync.py index eded0854..0cc451c6 100644 --- a/trestlebot/entrypoints/autosync.py +++ b/trestlebot/entrypoints/autosync.py @@ -66,6 +66,12 @@ def setup_autosync_arguments(self) -> None: help="Comma-separated list of glob patterns of the chosen model type to skip when running \ tasks", ) + self.parser.add_argument( + "--version", + type=str, + required=False, + help="Version of the OSCAL model to set during assembly into JSON.", + ) self.parser.add_argument( "--skip-assemble", required=False, @@ -134,6 +140,7 @@ def run(self, args: argparse.Namespace) -> None: assemble_task: AssembleTask = AssembleTask( authored_object=authored_object, markdown_dir=args.markdown_path, + version=args.version, model_filter=model_filter, ) pre_tasks.append(assemble_task)