diff --git a/actions/README.md b/actions/README.md index 3a450dd9..8341c4b9 100644 --- a/actions/README.md +++ b/actions/README.md @@ -6,16 +6,20 @@ This document provides instructions and examples for creating and using GitHub A ## Directory Structure -- Actions related to trestle-bot are located in the `trestlebot/actions` directory. -- Entrypoint scripts for actions are stored in the `trestlebot/entrypoints` directory. +- Actions related to trestle-bot are located in the `actions` directory. +- Actions should correlate an entrypoint under the `trestlebot/entrypoints` directory. ## Adding a New Action Contributors should scope trestle-bot actions to workspace management and checks. To add a new action: -1. Create an entrypoint script for the action in the `trestlebot/entrypoints` directory. -2. Create a new directory in the `trestlebot/actions` directory. -3. In the new directory, create an `action.yml` file that references your entrypoint script. +> Prerequisite: An entrypoint was created under the `trestlebot/entrypoints` directory and added to the `pyproject.toml` under `[tool.poetry.scripts]` + +1. Create a new directory in the `actions` directory. +2. In the new directory, create an `action.yml` file that references the Dockerfile in the root of the repository. +3. Add a README with markers to auto update the inputs and outputs from the `action.yml`. See an existing `README.md` for examples. +4. Create a bash script to run the entrypoint command and add any GitHub Actions specific logic. See `actions/common.sh` for reusable logic. +5. Add the the bash script to the Dockerfile to ensure it exists in the built image For more details, consult the [GitHub Actions documentation](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action). @@ -178,4 +182,4 @@ jobs: with: pr-number: | ${{ steps.trestlebot.outputs.pr_number }} -``` \ No newline at end of file +```