Skip to content
Merged
Show file tree
Hide file tree
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
Binary file modified .DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions .github/workflows/prnote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PRNote

on:
pull_request:
types: [opened]

permissions:
contents: read
pull-requests: write

jobs:
generate-pr-note:
runs-on: ubuntu-latest
steps:
- name: Generate PR title and description
uses: richardj46/prnote-action@v0.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ Requires Node.js 20 or newer.
```sh
cp .env.example .env
npm install
set -a; source .env; set +a
npm run dev
```

GitHub must be able to reach the webhook URL, so expose port 3000 with a trusted tunnel for local development. The app intentionally does not load `.env` itself; production secrets should come from the hosting platform.
GitHub must be able to reach the webhook URL, so expose port 3000 with a trusted tunnel for local development. The app automatically loads `.env` from its working directory. Variables already provided by the hosting platform take precedence.

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"format:check": "prettier --check ."
},
"engines": {
"node": ">=20"
"node": ">=20.12"
},
"dependencies": {
"minimatch": "^10.0.1"
Expand Down
8 changes: 8 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { createServer } from "node:http";
import { loadEnvFile } from "node:process";
import { verifyWebhook } from "./auth.js";
import { readConfig } from "./config.js";
import { processPullRequest } from "./processor.js";
import type { PullRequestOpenedPayload } from "./types.js";

try {
loadEnvFile();
} catch (error) {
const code = (error as NodeJS.ErrnoException).code;
if (code !== "ENOENT") throw error;
}

const config = readConfig();
const maxBodyBytes = 25 * 1024 * 1024;

Expand Down
Loading