Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README under actions directory #192

Merged
merged 6 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
```
```
Loading