Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole White committed Sep 10, 2023
1 parent e8f6949 commit 9c8a3a1
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# GitHub Actions from Autoblocks

* [`replay`](./replay/README.md) - Replay Autoblocks events through your LLM application
* [`neon`](./neon/README.md) - Actions for creating and deleting [Neon branches](https://neon.tech/docs/introduction/branching)
106 changes: 104 additions & 2 deletions neon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Neon Branching in GitHub Actions

These actions allow you to easily manage [Neon branches](https://neon.tech/docs/introduction/branching) as you make changes in your repository. Usage is as simple as:
These actions allow you to easily manage [Neon branches](https://neon.tech/docs/introduction/branching) within your GitHub Actions workflows. Usage is as simple as:

```yaml
name: CI
Expand Down Expand Up @@ -57,7 +57,7 @@ This project provides two actions:
**`create-branch`**:

This action creates a Neon branch for the current GitHub branch and commit. The Neon branch name will be the GitHub branch name plus the first seven characters of the commit SHA. For example, if you create a branch called `feat/my-feature` and push three commits, the following Neon branches will be created:
This action creates a Neon branch for the current GitHub branch and commit. The Neon branch name will be the GitHub branch name plus the first seven characters of the commit SHA. For example, if you create a GitHub branch called `feat/my-feature` and push three commits, the following Neon branches will be created:

- `feat/my-feature-61b5d0a`
- `feat/my-feature-ff2a8ea`
Expand All @@ -69,6 +69,108 @@ The Neon branch that is created always branches off of your primary Neon branch.

This action deletes all Neon branches associated with the deleted GitHub branch. From the example above, when you delete the `feat/my-feature` branch either directly or by merging its pull request (and have your repository set up to automatically delete branches when pull requests are merged), then the three Neon branches will be deleted.

## Supported Events

The supported events are:

- `push`
- `pull_request`
- `delete`

The branch name is determined automatically from the event. For `push` and `pull_request` events, the branch name is the name of the branch that was pushed or the name of the branch that the pull request is for. For `delete` events, the branch name is the name of the branch that was deleted.

Note that you can use any combination of these events to create and delete Neon branches:

- Create branches on `push`
- Delete branches on `delete`

```yaml
name: CI
on: push
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: autoblocksai/actions/neon/create-branch@v1
with:
api-key: ${{ secrets.NEON_API_KEY }}
project-id: ${{ vars.NEON_PROJECT_ID }}
```

```yaml
name: Cleanup
on: delete
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- uses: autoblocksai/actions/neon/delete-branches@v1
with:
api-key: ${{ secrets.NEON_API_KEY }}
project-id: ${{ vars.NEON_PROJECT_ID }}
```

- Create branches on `pull_request`
- Delete branches on `pull_request` (set `types` to `[closed]`)

```yaml
name: CI
on: pull_request
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: autoblocksai/actions/neon/create-branch@v1
with:
api-key: ${{ secrets.NEON_API_KEY }}
project-id: ${{ vars.NEON_PROJECT_ID }}
```

```yaml
name: Cleanup
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- uses: autoblocksai/actions/neon/delete-branches@v1
with:
api-key: ${{ secrets.NEON_API_KEY }}
project-id: ${{ vars.NEON_PROJECT_ID }}
```

- Create branches on `pull_request`
- Delete branches on `delete`

```yaml
name: CI
on: pull_request
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: autoblocksai/actions/neon/create-branch@v1
with:
api-key: ${{ secrets.NEON_API_KEY }}
project-id: ${{ vars.NEON_PROJECT_ID }}
```

```yaml
name: Cleanup
on: delete
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- uses: autoblocksai/actions/neon/delete-branches@v1
with:
api-key: ${{ secrets.NEON_API_KEY }}
project-id: ${{ vars.NEON_PROJECT_ID }}
```

## `create-branch`

### Inputs
Expand Down

0 comments on commit 9c8a3a1

Please sign in to comment.