Skip to content

Commit

Permalink
docs: update README under actions directory (#192)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jpower432 committed Mar 25, 2024
1 parent 87fc2c6 commit 8c290c3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -178,4 +182,4 @@ jobs:
with:
pr-number: |
${{ steps.trestlebot.outputs.pr_number }}
```
```

0 comments on commit 8c290c3

Please sign in to comment.