Skip to content

Commit

Permalink
Allow set of MAX_PR_COUNT from environment (#286)
Browse files Browse the repository at this point in the history
* Allow set of MAX_PR_COUNT from environment
  • Loading branch information
agershman authored Sep 22, 2024
1 parent d1203c0 commit f981436
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"}}');

/***/ })

Expand Down
2 changes: 1 addition & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f981436

Please sign in to comment.