From 8040a20ffc3824c1c1e733ef4b9e820875a35cb5 Mon Sep 17 00:00:00 2001 From: "Richard J." Date: Sun, 12 Jul 2026 09:59:02 +0100 Subject: [PATCH 1/2] misc: point updated prnote-action --- .github/workflows/prnote.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/prnote.yml diff --git a/.github/workflows/prnote.yml b/.github/workflows/prnote.yml new file mode 100644 index 0000000..6cc76d3 --- /dev/null +++ b/.github/workflows/prnote.yml @@ -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 }} From a42e71241ae4231768b748fe2f5129e519856eac Mon Sep 17 00:00:00 2001 From: "Richard J." Date: Sun, 12 Jul 2026 11:46:55 +0100 Subject: [PATCH 2/2] fix: load env variables when starting --- .DS_Store | Bin 6148 -> 6148 bytes README.md | 3 +-- package.json | 2 +- src/server.ts | 8 ++++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index b7f6d3089453489580ed4dc3bc68d06ccf98114b..cdf4d7a6c4c4712f5f65d6d959fc7676945a7539 100644 GIT binary patch delta 199 zcmZoMXfc=|#>B!kF;Q%yo+6{b#(>?7iw`g}F$zrPVXCfYVaR02V@PAj&q+57PR`FQ zU_b!4TyDOLOHxjL5>SeRfuW(`B;yH3AR9?O1+RQT28P)@KwI+}QYPB)qF;Q%yo+2a9#(>?7j69QhSgJSwXW?MpSWv;VnVo~51E^%PAjfy+ V$^0UY91K9f$iTp|IYML&GXPOP57Phu diff --git a/README.md b/README.md index fca1777..54cbfb7 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 34554dc..9a5f4e9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "format:check": "prettier --check ." }, "engines": { - "node": ">=20" + "node": ">=20.12" }, "dependencies": { "minimatch": "^10.0.1" diff --git a/src/server.ts b/src/server.ts index 63e8994..9f0d798 100644 --- a/src/server.ts +++ b/src/server.ts @@ -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;