Skip to content

Commit 51277a0

Browse files
authored
feat: add docs (#13)
1 parent 74242fc commit 51277a0

8 files changed

Lines changed: 290 additions & 22 deletions

File tree

README.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,19 @@
22

33
Shared GitHub Actions for the `bombshell-dev` organization.
44

5-
## mergebot
6-
7-
This workflow posts a celebratory message in a Discord channel of your choice for each commit. For example:
8-
9-
> 🥳 Merged! user-a: commit (#001)
10-
> With essential contributions from user-b and user-c! 💣
11-
12-
### Usage
13-
```yml
14-
name: mergebot
15-
16-
on:
17-
push:
18-
branches: [main]
19-
20-
jobs:
21-
mergebot:
22-
if: ${{ github.repository_owner == 'bombshell-dev' }}
23-
uses: bombshell-dev/automation/mergebot.yml@main
24-
secrets:
25-
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_MERGEBOT }}
26-
```
5+
## Workflows
6+
7+
All workflows are [reusable](https://docs.github.com/en/actions/sharing-automations/reusing-workflows) and called via `workflow_call`.
8+
9+
| Workflow | Description |
10+
| --- | --- |
11+
| [mergebot](docs/mergebot.md) | Post celebratory Discord messages on merge, with co-author recognition |
12+
| [run](docs/run.md) | Run package.json scripts in parallel via matrix |
13+
| [format](docs/format.md) | Auto-format code on PRs and commit the result |
14+
| [preview](docs/preview.md) | Publish preview packages to pkg.pr.new |
15+
| [publish](docs/publish.md) | Create release PRs or publish to npm via changesets |
16+
| [add-issue-to-project](docs/add-issue-to-project.md) | Add new issues to the GitHub Project with "Needs triage" status |
17+
| [move-issue-to-backlog](docs/move-issue-to-backlog.md) | Move closed issues to "Backlog" in the GitHub Project |
2718

2819
## Acknowledgements
2920

docs/add-issue-to-project.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# add-issue-to-project
2+
3+
Automatically adds newly created issues to the `bombshell-dev` GitHub Project (V2) and sets their status to **Needs triage**.
4+
5+
## Inputs
6+
7+
None.
8+
9+
## Secrets
10+
11+
| Name | Required | Description |
12+
| --- | --- | --- |
13+
| `BOT_APP_ID` | Yes | GitHub App ID for authentication. |
14+
| `BOT_PRIVATE_KEY` | Yes | GitHub App private key for authentication. |
15+
16+
## Usage
17+
18+
```yaml
19+
name: Add issue to project
20+
21+
on:
22+
issues:
23+
types: [opened]
24+
25+
jobs:
26+
add-to-project:
27+
uses: bombshell-dev/automation/.github/workflows/add-issue-to-project.yml@main
28+
secrets:
29+
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
30+
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
31+
```

docs/format.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# format
2+
3+
Auto-formats code on pull requests and commits the result. Runs a configurable `pnpm run` script, then commits any changes back to the PR branch.
4+
5+
## Inputs
6+
7+
| Name | Type | Required | Default | Description |
8+
| --- | --- | --- | --- | --- |
9+
| `command` | `string` | No | `"format"` | The `package.json` script to run via `pnpm run <command>`. |
10+
11+
## Secrets
12+
13+
| Name | Required | Description |
14+
| --- | --- | --- |
15+
| `BOT_APP_ID` | Yes | GitHub App ID for authentication. |
16+
| `BOT_PRIVATE_KEY` | Yes | GitHub App private key for authentication. |
17+
18+
## Usage
19+
20+
```yaml
21+
name: Format
22+
23+
on:
24+
pull_request:
25+
26+
jobs:
27+
format:
28+
uses: bombshell-dev/automation/.github/workflows/format.yml@main
29+
secrets:
30+
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
31+
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
32+
```
33+
34+
### Custom script name
35+
36+
```yaml
37+
jobs:
38+
format:
39+
uses: bombshell-dev/automation/.github/workflows/format.yml@main
40+
secrets:
41+
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
42+
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
43+
with:
44+
command: "prettier"
45+
```

docs/mergebot.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# mergebot
2+
3+
Posts a celebratory Discord message when a commit is pushed to a branch. Recognizes co-authors from `Co-authored-by` trailers.
4+
5+
> 🥳 **Merged!** user-a: [`commit message`](https://github.com/org/repo/commit/abc123)
6+
> _With essential contributions from user-b & user-c! 💣_
7+
8+
## Inputs
9+
10+
| Name | Type | Required | Default | Description |
11+
| --- | --- | --- | --- | --- |
12+
| `EMOJIS` | `string` | No | `🎉,🥳,💣,💥,🫡,🙌,👏,🙏,🏆` | Comma-delimited set of emojis. One is picked at random per message. |
13+
| `COAUTHOR_TEMPLATES` | `string` | No | _(see below)_ | JSON array of co-author recognition templates. Each must contain `<names>`. |
14+
15+
<details>
16+
<summary>Default <code>COAUTHOR_TEMPLATES</code></summary>
17+
18+
```json
19+
[
20+
"Thanks for the assist, <names>! 🙏",
21+
"<names> coming in clutch—thank you! 🙌",
22+
"<names> made it happen! 💪",
23+
"We couldn't have done it without <names>! 👏",
24+
"With essential contributions from <names>! 💣",
25+
"Teamwork makes the dream work… right <names>?! 🏆",
26+
"feat. <names>! 🫡"
27+
]
28+
```
29+
30+
</details>
31+
32+
## Secrets
33+
34+
| Name | Required | Description |
35+
| --- | --- | --- |
36+
| `DISCORD_WEBHOOK` | Yes | Discord webhook URL. Create one via Channel Settings > Integrations > Webhooks. |
37+
38+
## Usage
39+
40+
```yaml
41+
name: mergebot
42+
43+
on:
44+
push:
45+
branches: [main]
46+
47+
jobs:
48+
mergebot:
49+
if: ${{ github.repository_owner == 'bombshell-dev' }}
50+
uses: bombshell-dev/automation/.github/workflows/mergebot.yml@main
51+
secrets:
52+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_MERGEBOT }}
53+
```
54+
55+
### Custom emojis
56+
57+
```yaml
58+
jobs:
59+
mergebot:
60+
uses: bombshell-dev/automation/.github/workflows/mergebot.yml@main
61+
secrets:
62+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_MERGEBOT }}
63+
with:
64+
EMOJIS: "🚀,✨,🔥"
65+
```

docs/move-issue-to-backlog.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# move-issue-to-backlog
2+
3+
Moves closed issues to the **Backlog** column in the `bombshell-dev` GitHub Project (V2).
4+
5+
## Inputs
6+
7+
None.
8+
9+
## Secrets
10+
11+
| Name | Required | Description |
12+
| --- | --- | --- |
13+
| `BOT_APP_ID` | Yes | GitHub App ID for authentication. |
14+
| `BOT_PRIVATE_KEY` | Yes | GitHub App private key for authentication. |
15+
16+
## Usage
17+
18+
```yaml
19+
name: Move issue to backlog
20+
21+
on:
22+
issues:
23+
types: [closed]
24+
25+
jobs:
26+
move-to-backlog:
27+
uses: bombshell-dev/automation/.github/workflows/move-issue-to-backlog.yml@main
28+
secrets:
29+
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
30+
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
31+
```

docs/preview.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# preview
2+
3+
Publishes preview packages to [pkg.pr.new](https://pkg.pr.new) and templates to StackBlitz for pull requests.
4+
5+
## Inputs
6+
7+
| Name | Type | Required | Default | Description |
8+
| --- | --- | --- | --- | --- |
9+
| `publish` | `string` | No | `"./packages/**"` | Glob for directories to publish to pkg.pr.new. |
10+
| `template` | `string` | No | `"./examples/**"` | Glob for template directories to publish to StackBlitz. |
11+
12+
## Secrets
13+
14+
None.
15+
16+
## Usage
17+
18+
```yaml
19+
name: Preview
20+
21+
on:
22+
pull_request:
23+
24+
jobs:
25+
preview:
26+
uses: bombshell-dev/automation/.github/workflows/preview.yml@main
27+
```
28+
29+
### Custom paths
30+
31+
```yaml
32+
jobs:
33+
preview:
34+
uses: bombshell-dev/automation/.github/workflows/preview.yml@main
35+
with:
36+
publish: "./lib/**"
37+
template: "./templates/**"
38+
```
39+
40+
> **Note:** This workflow only runs for the `bombshell-dev` organization.

docs/publish.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# publish
2+
3+
Creates release pull requests or publishes packages to npm using [changesets](https://github.com/changesets/changesets).
4+
5+
When pending changesets exist, this workflow opens a release PR. When that PR is merged, it publishes the packages to npm.
6+
7+
## Inputs
8+
9+
None.
10+
11+
## Secrets
12+
13+
| Name | Required | Description |
14+
| --- | --- | --- |
15+
| `BOT_APP_ID` | Yes | GitHub App ID for authentication. |
16+
| `BOT_PRIVATE_KEY` | Yes | GitHub App private key for authentication. |
17+
18+
## Usage
19+
20+
```yaml
21+
name: Release
22+
23+
on:
24+
push:
25+
branches: [main]
26+
27+
jobs:
28+
publish:
29+
uses: bombshell-dev/automation/.github/workflows/publish.yml@main
30+
secrets:
31+
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
32+
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
33+
```
34+
35+
> **Note:** This workflow only runs for the `bombshell-dev` organization. Commits and PRs are authored by `bombshell-bot[bot]`.

docs/run.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# run
2+
3+
Runs one or more `package.json` scripts in parallel using a matrix strategy. Useful for lint, test, and type-check jobs.
4+
5+
## Inputs
6+
7+
| Name | Type | Required | Default | Description |
8+
| --- | --- | --- | --- | --- |
9+
| `commands` | `string` | Yes | &mdash; | JSON array of script names, e.g. `'["lint","test","types"]'` |
10+
11+
## Secrets
12+
13+
None.
14+
15+
## Usage
16+
17+
```yaml
18+
name: CI
19+
20+
on:
21+
pull_request:
22+
23+
jobs:
24+
check:
25+
uses: bombshell-dev/automation/.github/workflows/run.yml@main
26+
with:
27+
commands: '["lint","test","types"]'
28+
```
29+
30+
Each command runs as a separate matrix job, so they execute in parallel.

0 commit comments

Comments
 (0)