diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cef5186..4c1e483 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,11 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/javascript-node/.devcontainer/base.Dockerfile # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster -ARG VARIANT=20-bullseye -FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} +ARG VARIANT=24-trixie +FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT} # [Optional] Uncomment this section to install additional OS packages. RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends python pip + && apt-get -y install --no-install-recommends python3 python3-pip python-is-python3 pipx # [Optional] Uncomment if you want to install an additional version of node using nvm # ARG EXTRA_NODE_VERSION=10 @@ -16,5 +16,5 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # Intall aws cli RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install -# Install sam cli -RUN pip install aws-sam-cli \ No newline at end of file +# Install sam cli (use pipx because Debian Trixie's Python is PEP 668 externally-managed) +RUN PIPX_HOME=/usr/local/pipx PIPX_BIN_DIR=/usr/local/bin pipx install aws-sam-cli \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 19b3bbb..6f5fa0a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ // Update 'VARIANT' to pick a Node version: 16, 14, 12. // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local arm64/Apple Silicon. - "args": { "VARIANT": "20-bullseye" } + "args": { "VARIANT": "24-trixie" } }, "settings": {}, diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9f4c5ea..cdd96d2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 check-latest: true cache: npm - run: npm ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ae98ff..4aff69f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 check-latest: true cache: npm - run: npm ci diff --git a/handler.js b/handler.js index 60fd79a..5b2f4af 100644 --- a/handler.js +++ b/handler.js @@ -1,10 +1,20 @@ const { createLambdaFunction, createProbot, + ProbotOctokit, } = require("@probot/adapter-aws-lambda-serverless"); const appFn = require("./"); +const Octokit = ProbotOctokit.defaults({ + userAgent: "emergency-pull-request-probot-app", + request: { + headers: { + "X-GitHub-Api-Version": "2026-03-10", + }, + }, +}); + module.exports.webhooks = createLambdaFunction(appFn, { - probot: createProbot(), + probot: createProbot({ overrides: { Octokit } }), }); diff --git a/template.yml b/template.yml index 87778fa..04eb10e 100644 --- a/template.yml +++ b/template.yml @@ -87,7 +87,7 @@ Resources: Description: Basic Auth Funtion CodeUri: . Handler: handler.webhooks - Runtime: nodejs20.x + Runtime: nodejs24.x MemorySize: 256 Timeout: 20 Events: diff --git a/test.js b/test.js index e70f805..2ea6ed0 100644 --- a/test.js +++ b/test.js @@ -328,6 +328,11 @@ test.before.each(() => { Octokit: ProbotOctokit.defaults({ throttle: { enabled: false }, retry: { enabled: false }, + request: { + headers: { + "X-GitHub-Api-Version": "2026-03-10", + }, + }, }), }); probot.load(app);