Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow set of MAX_PR_COUNT from environment #286

Merged
merged 2 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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