@ffflorian/auto-merge 1.7.5 → 1.8.0
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 +2 -2
- package/dist/AutoMerge.js +2 -2
- package/dist/cli.js +2 -0
- package/package.json +2 -2
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
|
|
44
|
-
authToken
|
|
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
|
|
107
|
+
throw new Error('No projects specified');
|
|
108
108
|
}
|
|
109
109
|
if (!config.authToken) {
|
|
110
|
-
throw new Error('No authentication token
|
|
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