Skip to content

Commit 2ea3cc5

Browse files
author
Dan Clayton
committed
test
1 parent 1ab9511 commit 2ea3cc5

4 files changed

Lines changed: 566 additions & 15 deletions

File tree

packages/core/src/types/common.ts

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,128 @@
11
import type { GitHubWorkflows } from "./workflow";
22

3+
/**
4+
* Root resources for a .github directory structure including workflows.
5+
* Represents the complete .github directory with all workflows and other resources.
6+
*/
37
export type DotGitHubRootResources = DotGitHubResources & { workflows: GitHubWorkflows };
8+
9+
/**
10+
* Collection of resources in a .github directory.
11+
* Maps resource names to their configurations.
12+
*/
413
export type DotGitHubResources = Record<string, DotGitHubResource>;
514

15+
/**
16+
* Represents a resource in the .github directory structure.
17+
* Can be either a file with content or a directory with child resources.
18+
*/
619
export type DotGitHubResource = {
7-
/* File content, if a file */
20+
/** File content, if this resource is a file */
821
content?: unknown;
9-
/* Child resources, if a directory */
22+
/** Child resources, if this resource is a directory */
1023
children?: DotGitHubResources;
1124
}
1225

26+
/**
27+
* Complete representation of a .github directory structure.
28+
* Includes all workflows and other GitHub configuration resources.
29+
*/
1330
export type DotGitHub = DotGitHubRootResources;
1431

32+
/**
33+
* Possible values for GitHub Action inputs.
34+
* Actions can accept string, boolean, or numeric input values.
35+
*/
1536
export type GitHubActionInputValue = string | boolean | number;
1637

38+
/**
39+
* Configuration for a GitHub Action input parameter.
40+
* Defines how users can provide data to the action.
41+
*/
1742
export type GitHubActionInput ={
43+
/** Description of what this input does */
1844
description?: string;
45+
/** Whether this input is required for the action to run */
1946
required?: boolean | string;
47+
/** Default value if not provided by the user */
2048
default?: string | number | boolean;
2149
}
2250

23-
51+
/**
52+
* Configuration for a GitHub Action output.
53+
* Defines data that the action makes available to subsequent steps.
54+
*/
2455
export type GitHubActionOutput = {
56+
/** Description of what this output contains */
2557
description?: string;
2658
}
2759

2860

61+
/**
62+
* Complete metadata for a GitHub Action as defined in action.yml.
63+
* Contains all information needed to describe and run the action.
64+
*/
2965
export type GitHubActionYml = {
66+
/** Name of the action displayed in the GitHub Marketplace */
3067
name?: string;
68+
/** Detailed description of what the action does */
3169
description?: string;
70+
/** Author or organization that created the action */
3271
author?: string;
72+
/** Branding information for the GitHub Marketplace */
3373
branding?: {
74+
/** Color theme for the action's icon */
3475
color?: string;
76+
/** Icon identifier from GitHub's icon set */
3577
icon?: string;
3678
};
79+
/** Input parameters that users can provide */
3780
inputs?: GitHubActionInputs;
81+
/** Output values that the action produces */
3882
outputs?: GitHubActionOutputs;
83+
/** Runtime configuration for how the action executes */
3984
runs?: GitHubActionRuns;
4085
}
4186

4287

88+
/**
89+
* Runtime configuration for a GitHub Action.
90+
* Defines how the action should be executed when called.
91+
*/
4392
export type GitHubActionRuns = {
93+
/** Runtime environment (docker, node12, composite, etc.) */
4494
using: string;
95+
/** Main entry point file for the action */
4596
main?: string;
97+
/** Pre-execution setup script */
4698
pre?: string;
99+
/** Post-execution cleanup script */
47100
post?: string;
101+
/** Docker image to use for containerized actions */
48102
image?: string;
103+
/** Command line arguments for the action */
49104
args?: string[];
105+
/** Steps for composite actions */
50106
steps?: unknown[];
107+
/** Environment variables for the action runtime */
51108
env?: EnvVars;
52109
};
53110

54111

112+
/**
113+
* Collection of input parameters for a GitHub Action.
114+
* Maps input names to their configurations.
115+
*/
55116
export type GitHubActionInputs = Record<string, GitHubActionInput>;
117+
118+
/**
119+
* Collection of output values for a GitHub Action.
120+
* Maps output names to their configurations.
121+
*/
56122
export type GitHubActionOutputs = Record<string, GitHubActionOutput>;
123+
124+
/**
125+
* Environment variables configuration.
126+
* Maps environment variable names to their string values.
127+
*/
57128
export type EnvVars = Record<string, string>;

0 commit comments

Comments
 (0)