@tahminator/pipeline 1.0.86-beta.gcfa55584 → 1.0.86
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/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.86
|
|
6
|
+
"version": "1.0.86",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "git+https://github.com/tahminator/pipeline.git"
|
|
9
9
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import yargs from "yargs";
|
|
2
|
-
import { hideBin } from "yargs/helpers";
|
|
3
|
-
import { GitHubClient } from "../../gh";
|
|
4
|
-
const { sha, prId } = await yargs(hideBin(process.argv))
|
|
5
|
-
.option("sha", {
|
|
6
|
-
type: "string",
|
|
7
|
-
demandOption: true,
|
|
8
|
-
})
|
|
9
|
-
.option("prId", {
|
|
10
|
-
type: "number",
|
|
11
|
-
demandOption: true,
|
|
12
|
-
})
|
|
13
|
-
.strict()
|
|
14
|
-
.parse();
|
|
15
|
-
async function main() {
|
|
16
|
-
const { githubAppAppId, githubAppInstallationId, githubAppPrivateKey } = parseCiEnv(process.env);
|
|
17
|
-
const ghClient = await GitHubClient.createWithGithubAppToken({
|
|
18
|
-
appId: githubAppAppId,
|
|
19
|
-
installationId: githubAppInstallationId,
|
|
20
|
-
privateKey: githubAppPrivateKey,
|
|
21
|
-
});
|
|
22
|
-
await ghClient.sendPrMessage({
|
|
23
|
-
prId,
|
|
24
|
-
owner: "tahminator",
|
|
25
|
-
repository: "pipeline",
|
|
26
|
-
message: `
|
|
27
|
-
## Test Actions From This PR
|
|
28
|
-
|
|
29
|
-
Actions in this repository can be tested from this PR by referencing commit \`${sha}\` instead of a released version tag.
|
|
30
|
-
|
|
31
|
-
\`\`\`yaml
|
|
32
|
-
- uses: tahminator/pipeline/actions/setup@${sha}
|
|
33
|
-
\`\`\`
|
|
34
|
-
`,
|
|
35
|
-
});
|
|
36
|
-
console.log(`Sent action testing instructions for ${sha} to PR #${prId}.`);
|
|
37
|
-
}
|
|
38
|
-
function parseCiEnv(ciEnv) {
|
|
39
|
-
const githubAppAppId = (() => {
|
|
40
|
-
const v = ciEnv["_GITHUB_APP_APP_ID"];
|
|
41
|
-
if (!v) {
|
|
42
|
-
throw new Error("Missing _GITHUB_APP_APP_ID from env");
|
|
43
|
-
}
|
|
44
|
-
return v;
|
|
45
|
-
})();
|
|
46
|
-
const githubAppInstallationId = (() => {
|
|
47
|
-
const v = ciEnv["_GITHUB_APP_INSTALLATION_ID"];
|
|
48
|
-
if (!v) {
|
|
49
|
-
throw new Error("Missing _GITHUB_APP_INSTALLATION_ID from env");
|
|
50
|
-
}
|
|
51
|
-
return v;
|
|
52
|
-
})();
|
|
53
|
-
const githubAppPrivateKey = (() => {
|
|
54
|
-
const v = ciEnv["_GITHUB_APP_PEM_CONTENT"];
|
|
55
|
-
if (!v) {
|
|
56
|
-
throw new Error("Missing _GITHUB_APP_PEM_CONTENT from env");
|
|
57
|
-
}
|
|
58
|
-
return v;
|
|
59
|
-
})();
|
|
60
|
-
return { githubAppAppId, githubAppInstallationId, githubAppPrivateKey };
|
|
61
|
-
}
|
|
62
|
-
main()
|
|
63
|
-
.then(() => {
|
|
64
|
-
process.exit(0);
|
|
65
|
-
})
|
|
66
|
-
.catch((e) => {
|
|
67
|
-
console.error(e);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
});
|