Skip to content

Commit

Permalink
fix(actions): adds fixes to Dockerfile location and actions.yml for e…
Browse files Browse the repository at this point in the history
…ach each

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 12, 2023
1 parent 1b85b71 commit e9eba9b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion actions/autosync/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ outputs:

runs:
using: "docker"
image: "Dockerfile"
image: "../../Dockerfile"
entrypoint: "/auto-sync-entrypoint.sh"
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion actions/autosync/auto-sync-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}\" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ outputs:

runs:
using: "docker"
image: "../Dockerfile"
image: "../../Dockerfile"
entrypoint: "/rules-transform-entrypoint.sh"
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down
6 changes: 1 addition & 5 deletions actions/rules-transform/rules-transform-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}\" \
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion trestlebot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e9eba9b

Please sign in to comment.