From 87bdf77c105c76308bab3e833e3b132140ea087a Mon Sep 17 00:00:00 2001 From: Andrew Gershman Date: Mon, 16 Sep 2024 15:21:09 -0400 Subject: [PATCH 1/2] Allow set of MAX_PR_COUNT from environment --- README.md | 3 +++ lib/api.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 84da4ca..e571d05 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,8 @@ Also, the following general options are supported: - `BASE_BRANCHES`: If provided, the action will be restricted in terms of base branches. Can be comma-separated list of simple branch names (i.e `main,dev`). +- `MAX_PR_COUNT`: If provided, will control how many GitHub pull requests are considered in a single run. The default is `10`. + You can configure the environment variables in the workflow file like this: ```yaml @@ -231,6 +233,7 @@ You can configure the environment variables in the workflow file like this: UPDATE_LABELS: "" UPDATE_METHOD: "rebase" PULL_REQUEST: "1234" + MAX_PR_COUNT: "25" ``` ## Supported Events diff --git a/lib/api.js b/lib/api.js index b1756fa..18f76dd 100644 --- a/lib/api.js +++ b/lib/api.js @@ -30,7 +30,7 @@ const RELEVANT_ACTIONS = [ ]; // we'll only update a few PRs at once: -const MAX_PR_COUNT = 10; +const MAX_PR_COUNT = process.env.MAX_PR_COUNT || 10; async function executeLocally(context, url) { const { octokit } = context; From 63053866257c759ee7804e4f4dd468e7e796a9cf Mon Sep 17 00:00:00 2001 From: Pascal Date: Sun, 22 Sep 2024 20:52:49 +0200 Subject: [PATCH 2/2] Allow set of MAX_PR_COUNT from environment --- dist/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 31d1c93..b08b0d8 100755 --- a/dist/index.js +++ b/dist/index.js @@ -37,7 +37,7 @@ const RELEVANT_ACTIONS = [ ]; // we'll only update a few PRs at once: -const MAX_PR_COUNT = 10; +const MAX_PR_COUNT = process.env.MAX_PR_COUNT || 10; async function executeLocally(context, url) { const { octokit } = context; @@ -40705,7 +40705,7 @@ module.exports = parseParams /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"automerge-action","version":"0.16.2","description":"GitHub action to automatically merge pull requests","main":"lib/api.js","author":"Pascal","license":"MIT","private":true,"bin":{"automerge-action":"./bin/automerge.js"},"scripts":{"test":"jest","it":"node it/it.js","lint":"prettier -l lib/** test/** && eslint .","compile":"ncc build bin/automerge.js --license LICENSE -o dist","prepublish":"yarn lint && yarn test && yarn compile"},"dependencies":{"@actions/core":"^1.10.1","@octokit/rest":"^20.1.0","argparse":"^2.0.1","fs-extra":"^11.2.0","object-resolve-path":"^1.1.1","tmp":"^0.2.3"},"devDependencies":{"@vercel/ncc":"^0.38.1","dotenv":"^16.4.5","eslint":"^9.0.0","eslint-plugin-jest":"^28.2.0","globals":"^15.0.0","jest":"^29.7.0","prettier":"^3.2.5"},"prettier":{"trailingComma":"none","arrowParens":"avoid"}}'); +module.exports = JSON.parse('{"name":"automerge-action","version":"0.16.3","description":"GitHub action to automatically merge pull requests","main":"lib/api.js","author":"Pascal","license":"MIT","private":true,"bin":{"automerge-action":"./bin/automerge.js"},"scripts":{"test":"jest","it":"node it/it.js","lint":"prettier -l lib/** test/** && eslint .","compile":"ncc build bin/automerge.js --license LICENSE -o dist","prepublish":"yarn lint && yarn test && yarn compile"},"dependencies":{"@actions/core":"^1.10.1","@octokit/rest":"^20.1.0","argparse":"^2.0.1","fs-extra":"^11.2.0","object-resolve-path":"^1.1.1","tmp":"^0.2.3"},"devDependencies":{"@vercel/ncc":"^0.38.1","dotenv":"^16.4.5","eslint":"^9.0.0","eslint-plugin-jest":"^28.2.0","globals":"^15.0.0","jest":"^29.7.0","prettier":"^3.2.5"},"prettier":{"trailingComma":"none","arrowParens":"avoid"}}'); /***/ })