@firestartr/cli 1.55.0-snapshot-2 → 1.55.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/build/index.js CHANGED
@@ -354535,6 +354535,138 @@ async function createOrphanBranch(repo, branch, owner = 'prefapp') {
354535
354535
  createOrphanBranch,
354536
354536
  });
354537
354537
 
354538
+ ;// CONCATENATED MODULE: ../github/src/workflow.ts
354539
+
354540
+
354541
+ /**
354542
+ * Trigger a workflow_dispatch event
354543
+ * @param owner - GitHub organization
354544
+ * @param repo - Repository name
354545
+ * @param workflowId - Workflow file name (e.g., 'deploy.yaml') or workflow ID
354546
+ * @param ref - Git ref to run on (branch, tag, or SHA)
354547
+ * @param inputs - Workflow input key-value pairs (strings, numbers, or booleans)
354548
+ */
354549
+ async function triggerWorkflow(owner, repo, workflowId, ref, inputs) {
354550
+ github_src_logger.info(`Triggering workflow ${workflowId} in ${owner}/${repo} on ref ${ref}`);
354551
+ let octokit;
354552
+ try {
354553
+ octokit = await getOctokitForOrg(owner);
354554
+ }
354555
+ catch (error) {
354556
+ const message = error instanceof Error ? error.message : String(error);
354557
+ throw new Error(`Failed to get Octokit client for organization '${owner}' while triggering workflow '${workflowId}' in repository '${owner}/${repo}' on ref '${ref}': ${message}`);
354558
+ }
354559
+ await octokit.rest.actions.createWorkflowDispatch({
354560
+ owner,
354561
+ repo,
354562
+ workflow_id: workflowId,
354563
+ ref,
354564
+ inputs,
354565
+ });
354566
+ github_src_logger.info(`Workflow ${workflowId} triggered successfully`);
354567
+ }
354568
+ /**
354569
+ * Get workflow run details
354570
+ * @param owner - GitHub organization
354571
+ * @param repo - Repository name
354572
+ * @param runId - Workflow run ID
354573
+ */
354574
+ async function getWorkflowRun(owner, repo, runId) {
354575
+ github_src_logger.info(`Getting workflow run ${runId} for ${owner}/${repo}`);
354576
+ let octokit;
354577
+ try {
354578
+ octokit = await getOctokitForOrg(owner);
354579
+ }
354580
+ catch (error) {
354581
+ const message = error instanceof Error ? error.message : String(error);
354582
+ throw new Error(`Failed to get Octokit client for organization '${owner}' while getting workflow run '${runId}' in repository '${owner}/${repo}': ${message}`);
354583
+ }
354584
+ const response = await octokit.rest.actions.getWorkflowRun({
354585
+ owner,
354586
+ repo,
354587
+ run_id: runId,
354588
+ });
354589
+ return response.data;
354590
+ }
354591
+ /**
354592
+ * List recent workflow runs
354593
+ * @param owner - GitHub organization
354594
+ * @param repo - Repository name
354595
+ * @param workflowId - Optional workflow file name or ID to filter by
354596
+ * @param branch - Optional branch name to filter by
354597
+ * @param status - Optional status to filter by
354598
+ */
354599
+ async function listWorkflowRuns(owner, repo, workflowId, branch, status) {
354600
+ github_src_logger.info(`Listing workflow runs for ${owner}/${repo}`);
354601
+ let octokit;
354602
+ try {
354603
+ octokit = await getOctokitForOrg(owner);
354604
+ }
354605
+ catch (error) {
354606
+ const message = error instanceof Error ? error.message : String(error);
354607
+ throw new Error(`Failed to get Octokit client for organization '${owner}' while listing workflow runs in repository '${owner}/${repo}': ${message}`);
354608
+ }
354609
+ if (workflowId) {
354610
+ const response = await octokit.rest.actions.listWorkflowRuns({
354611
+ owner,
354612
+ repo,
354613
+ workflow_id: workflowId,
354614
+ branch,
354615
+ status,
354616
+ per_page: 100,
354617
+ });
354618
+ return response.data.workflow_runs;
354619
+ }
354620
+ else {
354621
+ const response = await octokit.rest.actions.listWorkflowRunsForRepo({
354622
+ owner,
354623
+ repo,
354624
+ branch,
354625
+ status,
354626
+ per_page: 100,
354627
+ });
354628
+ return response.data.workflow_runs;
354629
+ }
354630
+ }
354631
+ /**
354632
+ * Wait for workflow to complete with timeout
354633
+ * Polls on the provided interval. Default timeout is 5 minutes (300000ms).
354634
+ * @param owner - GitHub organization
354635
+ * @param repo - Repository name
354636
+ * @param runId - Workflow run ID
354637
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 300000ms / 5 minutes)
354638
+ * @param pollIntervalMs - Polling interval in milliseconds (default: 10000ms / 10 seconds)
354639
+ */
354640
+ async function waitForWorkflowCompletion(owner, repo, runId, timeoutMs = 300000, pollIntervalMs = 10000) {
354641
+ github_src_logger.info(`Waiting for workflow run ${runId} to complete (timeout: ${timeoutMs}ms, poll interval: ${pollIntervalMs}ms)`);
354642
+ const startTime = Date.now();
354643
+ while (Date.now() - startTime < timeoutMs) {
354644
+ const run = await getWorkflowRun(owner, repo, runId);
354645
+ github_src_logger.debug(`Workflow run ${runId} status: ${run.status}, conclusion: ${run.conclusion}`);
354646
+ if (run.status === 'completed') {
354647
+ github_src_logger.info(`Workflow run ${runId} completed with conclusion: ${run.conclusion}`);
354648
+ return {
354649
+ status: run.status,
354650
+ conclusion: run.conclusion,
354651
+ runId: run.id,
354652
+ htmlUrl: run.html_url,
354653
+ };
354654
+ }
354655
+ // Wait before polling again
354656
+ await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
354657
+ }
354658
+ // Timeout reached
354659
+ const run = await getWorkflowRun(owner, repo, runId);
354660
+ github_src_logger.warn(`Workflow run ${runId} did not complete within timeout`);
354661
+ throw new Error(`Workflow run ${runId} did not complete within ${timeoutMs}ms. Current status: ${run.status}. Workflow URL: ${run.html_url}`);
354662
+ }
354663
+ /* harmony default export */ const workflow = ({
354664
+ triggerWorkflow,
354665
+ getWorkflowRun,
354666
+ listWorkflowRuns,
354667
+ waitForWorkflowCompletion,
354668
+ });
354669
+
354538
354670
  ;// CONCATENATED MODULE: ../github/src/check_run.ts
354539
354671
 
354540
354672
 
@@ -354886,6 +355018,7 @@ async function encryptRepoSecret(owner, repo, section, plaintextValue) {
354886
355018
 
354887
355019
 
354888
355020
 
355021
+
354889
355022
  /* harmony default export */ const github_0 = ({
354890
355023
  org: organization,
354891
355024
  repo: repository,
@@ -354899,6 +355032,7 @@ async function encryptRepoSecret(owner, repo, section, plaintextValue) {
354899
355032
  pulls: pull_request,
354900
355033
  issues: issues,
354901
355034
  branches: branches,
355035
+ workflow: workflow,
354902
355036
  feedback: {
354903
355037
  createCheckRun: createCheckRun,
354904
355038
  CheckRun: CheckRun,
@@ -357903,7 +358037,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
357903
358037
  },
357904
358038
  owner: {
357905
358039
  type: 'string',
357906
- pattern: '^(user|group):\\S+$',
358040
+ pattern: '^(user|group):[a-zA-Z0-9_-]+$',
357907
358041
  },
357908
358042
  },
357909
358043
  required: ['description', 'owner'],
@@ -376185,9 +376319,9 @@ const crs_analyzerSubcommand = {
376185
376319
  };
376186
376320
 
376187
376321
  ;// CONCATENATED MODULE: ./package.json
376188
- const package_namespaceObject = JSON.parse('{"i8":"1.55.0-snapshot-2"}');
376322
+ const package_namespaceObject = {"i8":"1.55.0"};
376189
376323
  ;// CONCATENATED MODULE: ../../package.json
376190
- const package_namespaceObject_1 = {"i8":"1.54.0"};
376324
+ const package_namespaceObject_1 = {"i8":"1.55.0"};
376191
376325
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
376192
376326
 
376193
376327
 
@@ -3,6 +3,7 @@ import { upsertMultiPartStickyComments } from './src/sticky_comment';
3
3
  import { getOctokitForOrg, getGithubAppToken, getOctokitFromPat } from './src/auth';
4
4
  import { encryptRepoSecret, getRepoPublicKey } from './src/encrypt';
5
5
  import type { RepoSecretsSection } from './src/encrypt';
6
+ import type { WorkflowCompletionResult, WorkflowDispatchInputs, WorkflowRunConclusion, WorkflowRunStatus, WorkflowRunStatusFilter, WorkflowRunSummary } from './src/workflow';
6
7
  declare const _default: {
7
8
  org: {
8
9
  getRepositoryList: typeof import("./src/organization").getRepositoryList;
@@ -77,6 +78,12 @@ declare const _default: {
77
78
  createBranch: typeof import("./src/branches").createBranch;
78
79
  createOrphanBranch: typeof import("./src/branches").createOrphanBranch;
79
80
  };
81
+ workflow: {
82
+ triggerWorkflow: typeof import("./src/workflow").triggerWorkflow;
83
+ getWorkflowRun: typeof import("./src/workflow").getWorkflowRun;
84
+ listWorkflowRuns: typeof import("./src/workflow").listWorkflowRuns;
85
+ waitForWorkflowCompletion: typeof import("./src/workflow").waitForWorkflowCompletion;
86
+ };
80
87
  feedback: {
81
88
  createCheckRun: typeof createCheckRun;
82
89
  CheckRun: typeof import("./src/check_run").GithubCheckRun;
@@ -89,3 +96,4 @@ declare const _default: {
89
96
  };
90
97
  export default _default;
91
98
  export { RepoSecretsSection };
99
+ export type { WorkflowCompletionResult, WorkflowDispatchInputs, WorkflowRunConclusion, WorkflowRunStatus, WorkflowRunStatusFilter, WorkflowRunSummary, };
@@ -0,0 +1,58 @@
1
+ export type WorkflowDispatchInputs = Record<string, string | number | boolean>;
2
+ export type WorkflowRunStatusFilter = 'completed' | 'in_progress' | 'queued';
3
+ export type WorkflowRunStatus = WorkflowRunStatusFilter | string;
4
+ export type WorkflowRunConclusion = 'success' | 'failure' | 'cancelled' | 'timed_out' | 'neutral' | 'action_required' | 'skipped' | 'stale' | 'unknown' | null | string;
5
+ export interface WorkflowRunSummary {
6
+ id: number;
7
+ status: WorkflowRunStatus;
8
+ conclusion: WorkflowRunConclusion;
9
+ html_url: string;
10
+ }
11
+ export interface WorkflowCompletionResult {
12
+ status: WorkflowRunStatus;
13
+ conclusion: WorkflowRunConclusion;
14
+ runId: number;
15
+ htmlUrl: string;
16
+ }
17
+ /**
18
+ * Trigger a workflow_dispatch event
19
+ * @param owner - GitHub organization
20
+ * @param repo - Repository name
21
+ * @param workflowId - Workflow file name (e.g., 'deploy.yaml') or workflow ID
22
+ * @param ref - Git ref to run on (branch, tag, or SHA)
23
+ * @param inputs - Workflow input key-value pairs (strings, numbers, or booleans)
24
+ */
25
+ export declare function triggerWorkflow(owner: string, repo: string, workflowId: string | number, ref: string, inputs?: WorkflowDispatchInputs): Promise<void>;
26
+ /**
27
+ * Get workflow run details
28
+ * @param owner - GitHub organization
29
+ * @param repo - Repository name
30
+ * @param runId - Workflow run ID
31
+ */
32
+ export declare function getWorkflowRun(owner: string, repo: string, runId: number): Promise<WorkflowRunSummary>;
33
+ /**
34
+ * List recent workflow runs
35
+ * @param owner - GitHub organization
36
+ * @param repo - Repository name
37
+ * @param workflowId - Optional workflow file name or ID to filter by
38
+ * @param branch - Optional branch name to filter by
39
+ * @param status - Optional status to filter by
40
+ */
41
+ export declare function listWorkflowRuns(owner: string, repo: string, workflowId?: string | number, branch?: string, status?: WorkflowRunStatusFilter): Promise<WorkflowRunSummary[]>;
42
+ /**
43
+ * Wait for workflow to complete with timeout
44
+ * Polls on the provided interval. Default timeout is 5 minutes (300000ms).
45
+ * @param owner - GitHub organization
46
+ * @param repo - Repository name
47
+ * @param runId - Workflow run ID
48
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 300000ms / 5 minutes)
49
+ * @param pollIntervalMs - Polling interval in milliseconds (default: 10000ms / 10 seconds)
50
+ */
51
+ export declare function waitForWorkflowCompletion(owner: string, repo: string, runId: number, timeoutMs?: number, pollIntervalMs?: number): Promise<WorkflowCompletionResult>;
52
+ declare const _default: {
53
+ triggerWorkflow: typeof triggerWorkflow;
54
+ getWorkflowRun: typeof getWorkflowRun;
55
+ listWorkflowRuns: typeof listWorkflowRuns;
56
+ waitForWorkflowCompletion: typeof waitForWorkflowCompletion;
57
+ };
58
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.55.0-snapshot-2",
3
+ "version": "1.55.0",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",