From 8c290c337f8c6e200fc42c0df9c7713fb4dc82bd Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Mon, 25 Mar 2024 12:35:10 -0400 Subject: [PATCH] docs: update README under actions directory (#192) * docs: update README under actions directory Some of the information in the doc has incorrect paths to the directories. This fixes that issue. * docs: refines add new action steps in README.md * docs: adds grammar/spelling fixes to actions README * docs: updates wording on "Add New Action" steps --- actions/README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 +```