@tahminator/pipeline 1.0.86-beta.gc40c691f → 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-beta.gc40c691f",
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,75 +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
- Composite actions in this repository can be tested before this PR merges by pointing \`uses:\` at this commit's SHA instead of a released version tag.
30
-
31
- For example, to test the \`setup\` action from this PR:
32
-
33
- \`\`\`yaml
34
- - uses: tahminator/pipeline/actions/setup@${sha}
35
- with:
36
- INSTALL_SOPS: "true"
37
- \`\`\`
38
-
39
- Swap \`actions/setup\` for any other action path in this repository (e.g. \`actions/headscale-connect-action\`) to test that action instead.
40
- `,
41
- });
42
- console.log(`Sent action testing instructions for ${sha} to PR #${prId}.`);
43
- }
44
- function parseCiEnv(ciEnv) {
45
- const githubAppAppId = (() => {
46
- const v = ciEnv["_GITHUB_APP_APP_ID"];
47
- if (!v) {
48
- throw new Error("Missing _GITHUB_APP_APP_ID from env");
49
- }
50
- return v;
51
- })();
52
- const githubAppInstallationId = (() => {
53
- const v = ciEnv["_GITHUB_APP_INSTALLATION_ID"];
54
- if (!v) {
55
- throw new Error("Missing _GITHUB_APP_INSTALLATION_ID from env");
56
- }
57
- return v;
58
- })();
59
- const githubAppPrivateKey = (() => {
60
- const v = ciEnv["_GITHUB_APP_PEM_CONTENT"];
61
- if (!v) {
62
- throw new Error("Missing _GITHUB_APP_PEM_CONTENT from env");
63
- }
64
- return v;
65
- })();
66
- return { githubAppAppId, githubAppInstallationId, githubAppPrivateKey };
67
- }
68
- main()
69
- .then(() => {
70
- process.exit(0);
71
- })
72
- .catch((e) => {
73
- console.error(e);
74
- process.exit(1);
75
- });