diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..274fdc7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + verify: + runs-on: ubuntu-24.04 + permissions: + contents: read + steps: + - uses: actions/checkout@v6 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v6 + with: + node-version-file: package.json + cache: pnpm + - run: pnpm install + - run: pnpm lint + - run: pnpm test + - run: pnpm typecheck diff --git a/README.md b/README.md index e3446ba..79821aa 100644 --- a/README.md +++ b/README.md @@ -119,24 +119,21 @@ Because GitHub and Telegram deliver events through webhooks, your bot must be ac If you are running the bot locally, use a tunneling tool such as: -- ngrok +- Smee.io +- Ngrok - Cloudflare Tunnel - LocalTunnel - Expose -### Example Using ngrok +### Example Using Smee.io -```bash -ngrok http 3000 -``` +1. Start a tunnel with the bundled script: -Use the generated HTTPS URL as your GitHub webhook endpoint: - -``` -https://.ngrok-free.app/api/webhook/github +```bash copy +pnpm smee --path /api/webhook/github ``` -Every restart may generate a new URL (you can have Fixed URL if you sign-up in ngrok) +2. Set the Forwarding URL as your GitHub webhook endpoint. ## Contributing diff --git a/lint-staged.config.js b/lint-staged.config.js index b541039..c67df85 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -4,6 +4,6 @@ */ export default { "*": "cspell", - "*.{js,mjs,ts}": "eslint --fix", + "*.{js,ts}": "eslint --fix", "*.{md,json}": "prettier --write", }; diff --git a/package.json b/package.json index 62da543..86d9c82 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "github-bot", "type": "module", "private": true, - "packageManager": "pnpm@10.22.0", + "packageManager": "pnpm@10.26.0", "imports": { "#config": [ "./src/config/index.ts" @@ -26,7 +26,7 @@ "scripts": { "dev": "node --watch --env-file-if-exists=.env src/index.ts", "start": "node --env-file-if-exists=.env src/index.ts", - "lint": "eslint . --fix", + "lint": "eslint .", "test": "node --test src/**/*.spec.ts", "test:watch": "node --watch --test src/**/*.spec.ts", "typecheck": "tsc", @@ -72,7 +72,6 @@ "typescript": "5.9.3" }, "volta": { - "node": "22.18.0", - "pnpm": "10.22.0" + "node": "24.12.0" } }