@tahminator/pipeline 1.0.76-beta.f1e3e65b → 1.0.76-beta.ffbeee6f
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.
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { EnvClient, EnvClientStrategy } from "../../env";
|
|
2
1
|
import { GitHubClient } from "../../gh";
|
|
3
|
-
import { Utils } from "../../utils";
|
|
4
2
|
import { VersioningClient, VersionUpdatingStrategy } from "../../versioning";
|
|
5
3
|
async function main() {
|
|
6
|
-
const
|
|
7
|
-
const { githubAppAppId, githubAppInstallationId, githubAppPrivateKeyB64 } = parseCiEnv(await envClient.readFromEnv(".env.ci"));
|
|
4
|
+
const { githubAppAppId, githubAppInstallationId, githubAppPrivateKey } = parseCiEnv(process.env);
|
|
8
5
|
const ghClient = await GitHubClient.createWithGithubAppToken({
|
|
9
6
|
appId: githubAppAppId,
|
|
10
7
|
installationId: githubAppInstallationId,
|
|
11
|
-
privateKey:
|
|
8
|
+
privateKey: githubAppPrivateKey,
|
|
12
9
|
});
|
|
13
10
|
const versioningClient = new VersioningClient(ghClient, VersionUpdatingStrategy.JSTS);
|
|
14
11
|
const rootPkgJson = await Bun.file("./package.json").json();
|
|
@@ -25,27 +22,27 @@ async function main() {
|
|
|
25
22
|
}
|
|
26
23
|
function parseCiEnv(ciEnv) {
|
|
27
24
|
const githubAppAppId = (() => {
|
|
28
|
-
const v = ciEnv["
|
|
25
|
+
const v = ciEnv["_GITHUB_APP_APP_ID"];
|
|
29
26
|
if (!v) {
|
|
30
|
-
throw new Error("Missing
|
|
27
|
+
throw new Error("Missing _GITHUB_APP_APP_ID from env");
|
|
31
28
|
}
|
|
32
29
|
return v;
|
|
33
30
|
})();
|
|
34
31
|
const githubAppInstallationId = (() => {
|
|
35
|
-
const v = ciEnv["
|
|
32
|
+
const v = ciEnv["_GITHUB_APP_INSTALLATION_ID"];
|
|
36
33
|
if (!v) {
|
|
37
|
-
throw new Error("Missing
|
|
34
|
+
throw new Error("Missing _GITHUB_APP_INSTALLATION_ID from env");
|
|
38
35
|
}
|
|
39
36
|
return v;
|
|
40
37
|
})();
|
|
41
|
-
const
|
|
42
|
-
const v = ciEnv["
|
|
38
|
+
const githubAppPrivateKey = (() => {
|
|
39
|
+
const v = ciEnv["_GITHUB_APP_PEM_CONTENT"];
|
|
43
40
|
if (!v) {
|
|
44
|
-
throw new Error("Missing
|
|
41
|
+
throw new Error("Missing _GITHUB_APP_PEM_CONTENT from env");
|
|
45
42
|
}
|
|
46
43
|
return v;
|
|
47
44
|
})();
|
|
48
|
-
return { githubAppAppId, githubAppInstallationId,
|
|
45
|
+
return { githubAppAppId, githubAppInstallationId, githubAppPrivateKey };
|
|
49
46
|
}
|
|
50
47
|
main()
|
|
51
48
|
.then(() => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import yargs from "yargs";
|
|
2
2
|
import { hideBin } from "yargs/helpers";
|
|
3
|
-
import { EnvClient, EnvClientStrategy } from "../../../env";
|
|
4
3
|
import { GitHubClient } from "../../../gh";
|
|
5
4
|
import { NPMClient } from "../../../npm";
|
|
6
5
|
import { Utils } from "../../../utils";
|
|
@@ -18,12 +17,11 @@ const { sha, prId } = await yargs(hideBin(process.argv))
|
|
|
18
17
|
.strict()
|
|
19
18
|
.parse();
|
|
20
19
|
async function main() {
|
|
21
|
-
const
|
|
22
|
-
const { githubAppAppId, githubAppInstallationId, githubAppPrivateKeyB64 } = parseCiEnv(await envClient.readFromEnv(".env.ci"));
|
|
20
|
+
const { githubAppAppId, githubAppInstallationId, githubAppPrivateKey } = parseCiEnv(process.env);
|
|
23
21
|
const ghClient = await GitHubClient.createWithGithubAppToken({
|
|
24
22
|
appId: githubAppAppId,
|
|
25
23
|
installationId: githubAppInstallationId,
|
|
26
|
-
privateKey:
|
|
24
|
+
privateKey: githubAppPrivateKey,
|
|
27
25
|
});
|
|
28
26
|
const npmClient = await NPMClient.create();
|
|
29
27
|
const versioningClient = new VersioningClient(ghClient, VersionUpdatingStrategy.JSTS);
|
|
@@ -55,27 +53,27 @@ async function getShortSha(sha) {
|
|
|
55
53
|
}
|
|
56
54
|
function parseCiEnv(ciEnv) {
|
|
57
55
|
const githubAppAppId = (() => {
|
|
58
|
-
const v = ciEnv["
|
|
56
|
+
const v = ciEnv["_GITHUB_APP_APP_ID"];
|
|
59
57
|
if (!v) {
|
|
60
|
-
throw new Error("Missing
|
|
58
|
+
throw new Error("Missing _GITHUB_APP_APP_ID from env");
|
|
61
59
|
}
|
|
62
60
|
return v;
|
|
63
61
|
})();
|
|
64
62
|
const githubAppInstallationId = (() => {
|
|
65
|
-
const v = ciEnv["
|
|
63
|
+
const v = ciEnv["_GITHUB_APP_INSTALLATION_ID"];
|
|
66
64
|
if (!v) {
|
|
67
|
-
throw new Error("Missing
|
|
65
|
+
throw new Error("Missing _GITHUB_APP_INSTALLATION_ID from env");
|
|
68
66
|
}
|
|
69
67
|
return v;
|
|
70
68
|
})();
|
|
71
|
-
const
|
|
72
|
-
const v = ciEnv["
|
|
69
|
+
const githubAppPrivateKey = (() => {
|
|
70
|
+
const v = ciEnv["_GITHUB_APP_PEM_CONTENT"];
|
|
73
71
|
if (!v) {
|
|
74
|
-
throw new Error("Missing
|
|
72
|
+
throw new Error("Missing _GITHUB_APP_PEM_CONTENT from env");
|
|
75
73
|
}
|
|
76
74
|
return v;
|
|
77
75
|
})();
|
|
78
|
-
return { githubAppAppId, githubAppInstallationId,
|
|
76
|
+
return { githubAppAppId, githubAppInstallationId, githubAppPrivateKey };
|
|
79
77
|
}
|
|
80
78
|
main()
|
|
81
79
|
.then(() => {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Tahmid Ahmed",
|
|
5
5
|
"description": "A collection of Bun shell scripts that can be re-used in various CICD pipelines.",
|
|
6
|
-
"version": "1.0.76-beta.
|
|
6
|
+
"version": "1.0.76-beta.ffbeee6f",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "git+https://github.com/tahminator/pipeline.git"
|
|
9
9
|
},
|