forked from semantic-release/gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (31 loc) · 949 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* eslint require-atomic-updates: off */
import verifyGitLab from "./lib/verify.js";
import publishGitLab from "./lib/publish.js";
import successGitLab from "./lib/success.js";
import failGitLab from "./lib/fail.js";
let verified;
export async function verifyConditions(pluginConfig, context) {
await verifyGitLab(pluginConfig, context);
verified = true;
}
export async function publish(pluginConfig, context) {
if (!verified) {
await verifyGitLab(pluginConfig, context);
verified = true;
}
return publishGitLab(pluginConfig, context);
}
export async function success(pluginConfig, context) {
if (!verified) {
await verifyGitLab(pluginConfig, context);
verified = true;
}
return successGitLab(pluginConfig, context);
}
export async function fail(pluginConfig, context) {
if (!verified) {
await verifyGitLab(pluginConfig, context);
verified = true;
}
return failGitLab(pluginConfig, context);
}