@ffflorian/auto-merge 1.7.5 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,8 +40,8 @@ The structure of the configuration file is the following:
40
40
 
41
41
  ```ts
42
42
  {
43
- /** The GitHub auth token (needs read and write access to code and pull requests) */
44
- authToken: string;
43
+ /** The GitHub auth token (needs read and write access to repository and pull requests) */
44
+ authToken?: string;
45
45
  /** Approve before merging */
46
46
  autoApprove?: boolean;
47
47
  /** Don't send any data */
package/dist/AutoMerge.js CHANGED
@@ -104,10 +104,10 @@ export class AutoMerge {
104
104
  checkConfig(config) {
105
105
  var _a;
106
106
  if (!((_a = config.projects) === null || _a === void 0 ? void 0 : _a.gitHub) || config.projects.gitHub.length < 1) {
107
- throw new Error('No projects in config file specified');
107
+ throw new Error('No projects specified');
108
108
  }
109
109
  if (!config.authToken) {
110
- throw new Error('No authentication token in config file specified');
110
+ throw new Error('No authentication token specified');
111
111
  }
112
112
  }
113
113
  checkRepositorySlug(repositorySlug) {
package/dist/cli.js CHANGED
@@ -24,6 +24,7 @@ commander
24
24
  .option('-d, --dry-run', `don't send any data`)
25
25
  .option('-f, --merge-drafts', 'merge draft PRs', false)
26
26
  .option('-s, --squash', 'squash when merging', false)
27
+ .option('-t, --token <token>', 'GitHub auth token (needs read and write access to repository and pull requests)')
27
28
  .version(version)
28
29
  .parse(process.argv);
29
30
  const commanderOptions = commander.opts();
@@ -37,6 +38,7 @@ if (!configResult || configResult.isEmpty) {
37
38
  }
38
39
  const configFileData = {
39
40
  ...configResult.config,
41
+ ...(commanderOptions.token && { authToken: commanderOptions.token }),
40
42
  ...(commanderOptions.approve && { autoApprove: commanderOptions.approve }),
41
43
  ...(commanderOptions.dryRun && { dryRun: commanderOptions.dryRun }),
42
44
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "bin": "dist/cli.js",
4
4
  "dependencies": {
5
5
  "commander": "14.0.3",
6
- "cosmiconfig": "9.0.0",
6
+ "cosmiconfig": "9.0.1",
7
7
  "logdown": "3.3.1"
8
8
  },
9
9
  "description": "Automatically merge (and optionally approve) all GitHub PRs which match a specific pattern.",
@@ -12,7 +12,7 @@
12
12
  "nock": "14.0.11",
13
13
  "tsx": "4.21.0",
14
14
  "typescript": "6.0.2",
15
- "vitest": "4.0.18"
15
+ "vitest": "4.1.0"
16
16
  },
17
17
  "engines": {
18
18
  "node": ">= 21"
@@ -39,6 +39,6 @@
39
39
  "test": "vitest run"
40
40
  },
41
41
  "type": "module",
42
- "version": "1.7.5",
43
- "gitHead": "2d037f034a0b123365736d4705fbfaa179365ef3"
42
+ "version": "1.8.1",
43
+ "gitHead": "aa42364cabdedc7bba727430cb686713f4598ce8"
44
44
  }