diff --git a/Dockerfile b/Dockerfile index 7e1958bd..a19bbbd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,6 +67,7 @@ RUN microdnf install -y git \ && microdnf clean all \ && rm -rf /var/lib/apt/lists/* +# Add wrappers for entrypoints that provide support the actions COPY ./actions/autosync/auto-sync-entrypoint.sh / RUN chmod +x /auto-sync-entrypoint.sh diff --git a/actions/autosync/action.yml b/actions/autosync/action.yml index 1263f6fa..3353b3c9 100644 --- a/actions/autosync/action.yml +++ b/actions/autosync/action.yml @@ -81,7 +81,7 @@ outputs: runs: using: "docker" - image: "Dockerfile" + image: "../../Dockerfile" entrypoint: "/auto-sync-entrypoint.sh" env: GITHUB_TOKEN: ${{ inputs.github_token }} diff --git a/actions/autosync/auto-sync-entrypoint.sh b/actions/autosync/auto-sync-entrypoint.sh index 732a183c..48103923 100644 --- a/actions/autosync/auto-sync-entrypoint.sh +++ b/actions/autosync/auto-sync-entrypoint.sh @@ -20,7 +20,7 @@ else fi # Initialize the command variable -command="python3.9 -m trestlebot \ +command="trestlebot-autosync \ --markdown-path=\"${INPUT_MARKDOWN_PATH}\" \ --oscal-model=\"${INPUT_OSCAL_MODEL}\" \ --ssp-index-path=\"${INPUT_SSP_INDEX_PATH}\" \ diff --git a/actions/rules-transform/actions.yml b/actions/rules-transform/action.yml similarity index 99% rename from actions/rules-transform/actions.yml rename to actions/rules-transform/action.yml index 7f242b43..9728325b 100644 --- a/actions/rules-transform/actions.yml +++ b/actions/rules-transform/action.yml @@ -62,7 +62,7 @@ outputs: runs: using: "docker" - image: "../Dockerfile" + image: "../../Dockerfile" entrypoint: "/rules-transform-entrypoint.sh" env: GITHUB_TOKEN: ${{ inputs.github_token }} diff --git a/actions/rules-transform/rules-transform-entrypoint.sh b/actions/rules-transform/rules-transform-entrypoint.sh index 2dc6274e..55444170 100644 --- a/actions/rules-transform/rules-transform-entrypoint.sh +++ b/actions/rules-transform/rules-transform-entrypoint.sh @@ -20,7 +20,7 @@ else fi # Initialize the command variable -command="python3.9 /trestle-bot/trestlebot/entrypoints/rules-tranform.py \ +command="trestlebot-rules-transform \ --rules-view-path=\"${INPUT_RULES_VIEW_PATH}\" \ --commit-message=\"${INPUT_COMMIT_MESSAGE}\" \ --pull-request-title=\"${INPUT_PULL_REQUEST_TITLE}\" \ @@ -35,10 +35,6 @@ command="python3.9 /trestle-bot/trestlebot/entrypoints/rules-tranform.py \ --skip-items=\"${INPUT_SKIP_ITEMS}\"" -if [[ ${INPUT_CHECK_ONLY} == true ]]; then - command+=" --check-only" -fi - # Only set the token value when is a target branch so pull requests can be created if [[ -n ${INPUT_TARGET_BRANCH} ]]; then if [[ -z ${GITHUB_TOKEN} ]]; then diff --git a/pyproject.toml b/pyproject.toml index fd932fe5..913aa809 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,8 @@ readme = 'README.md' repository = 'https://github.com/RedHatProductSecurity/trestle-bot' [tool.poetry.scripts] -autosync = "trestlebot.entrypoints.autosync:main" -rules-transform = "trestlebot.entrypoints.rule_transform:main" +trestlebot-autosync = "trestlebot.entrypoints.autosync:main" +trestlebot-rules-transform = "trestlebot.entrypoints.rule_transform:main" [tool.poetry.dependencies] python = '^3.8.1' diff --git a/trestlebot/__main__.py b/trestlebot/__main__.py index 2b115f52..a8e9c8d2 100644 --- a/trestlebot/__main__.py +++ b/trestlebot/__main__.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -# Default entrypoint for trestlebot is autosync mode +# Default entrypoint for trestlebot is autosync mode when run with python -m trestlebot from trestlebot.entrypoints.autosync import main as autosync_main