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

Update oscal content so that it only runs on develop and main #255

Closed
wants to merge 2 commits into from
Closed
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
19 changes: 18 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SHELL:=/usr/bin/env bash
BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD)

.PHONY: help
# Run "make" or "make help" to get a list of user targets
Expand Down Expand Up @@ -184,6 +185,7 @@ validate-xml-content: $(GEN_XML_FILES) ## Validate XML files
#
.PHONY: validate-xml-by-cli
validate-xml-by-cli: $(OSCAL_CLI_INSTALL_PATH) ## Validate XML files by directory using OSCAL CLI Tool
ifeq ($(BRANCH_NAME),develop)
@echo "Validating XML files by directory using OSCAL CLI Tool"
@$(OSCAL_CLI_INSTALL_PATH)/bin/$(OSCAL_CLI_BIN) --version
@echo "latest oscal-cli version is $(OSCAL_CLI_VERSION)"
Expand All @@ -196,7 +198,22 @@ validate-xml-by-cli: $(OSCAL_CLI_INSTALL_PATH) ## Validate XML files by director
$(OSCAL_CLI_INSTALL_PATH)/bin/oscal-cli "$$example_type" validate "$$xml_file"; \
done \
done

else ifeq ($(BRANCH_NAME),main)
@echo "Validating XML files by directory using OSCAL CLI Tool"
@$(OSCAL_CLI_INSTALL_PATH)/bin/$(OSCAL_CLI_BIN) --version
@echo "latest oscal-cli version is $(OSCAL_CLI_VERSION)"
@echo "Validating OSCAL content with $(OSCAL_CLI_INSTALL_PATH)/bin/oscal-cli version $(OSCAL_CLI_VERSION)"
@find $(SRC_DIR)/examples -mindepth 1 -maxdepth 1 -type d | while read example_dir; do \
example_type=$$(basename "$$example_dir"); \
echo "Processing example type: $$example_type"; \
find "$$example_dir" -name '*.xml' | while read xml_file; do \
echo "Validating $$xml_file with OSCAL CLI as $$example_type"; \
$(OSCAL_CLI_INSTALL_PATH)/bin/oscal-cli "$$example_type" validate "$$xml_file"; \
done \
done
else
@echo "Skipping XML validation. Only runs on 'develop' and 'main' branches."
endif
.PHONY: clean-xml-content
clean-xml-content: ## Clean generated XML content
@echo Cleaning XML content
Expand Down