@actions/workflow-parser 0.3.29 → 0.3.31

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.
Files changed (32) hide show
  1. package/dist/action-v1.0.min.json +1 -0
  2. package/dist/actions/action-constants.d.ts +2 -0
  3. package/dist/actions/action-constants.d.ts.map +1 -0
  4. package/dist/actions/action-constants.js +2 -0
  5. package/dist/actions/action-constants.js.map +1 -0
  6. package/dist/actions/action-parser.d.ts +12 -0
  7. package/dist/actions/action-parser.d.ts.map +1 -0
  8. package/dist/actions/action-parser.js +28 -0
  9. package/dist/actions/action-parser.js.map +1 -0
  10. package/dist/actions/action-schema.d.ts +7 -0
  11. package/dist/actions/action-schema.d.ts.map +1 -0
  12. package/dist/actions/action-schema.js +16 -0
  13. package/dist/actions/action-schema.js.map +1 -0
  14. package/dist/actions/action-template.d.ts +89 -0
  15. package/dist/actions/action-template.d.ts.map +1 -0
  16. package/dist/actions/action-template.js +383 -0
  17. package/dist/actions/action-template.js.map +1 -0
  18. package/dist/actions/index.d.ts +6 -0
  19. package/dist/actions/index.d.ts.map +1 -0
  20. package/dist/actions/index.js +7 -0
  21. package/dist/actions/index.js.map +1 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/templates/template-parse-result.d.ts +10 -0
  26. package/dist/templates/template-parse-result.d.ts.map +1 -0
  27. package/dist/templates/template-parse-result.js +2 -0
  28. package/dist/templates/template-parse-result.js.map +1 -0
  29. package/dist/workflows/workflow-parser.d.ts +9 -7
  30. package/dist/workflows/workflow-parser.d.ts.map +1 -1
  31. package/dist/workflows/workflow-parser.js.map +1 -1
  32. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ { "definitions": { "action-root": { "description": "Action file", "mapping": { "properties": { "name": "string", "description": "string", "inputs": "inputs", "outputs": "outputs", "runs": "runs" }, "loose-key-type": "non-empty-string", "loose-value-type": "any" } }, "action-root-strict": { "description": "GitHub Action manifest file (action.yml/action.yaml) that defines an action's metadata, inputs, outputs, and execution configuration.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions)", "mapping": { "properties": { "name": { "type": "non-empty-string", "required": true, "description": "The name of your action. GitHub displays the name in the Actions tab to help visually identify actions in each job.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#name)" }, "description": { "type": "string", "required": true, "description": "A short description of the action. GitHub displays this description in the Actions Marketplace.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#description)" }, "author": { "type": "string", "description": "The name of the action's author.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#author)" }, "inputs": "inputs-strict", "outputs": "outputs", "runs": { "type": "runs-strict", "required": true }, "branding": "branding" } } }, "inputs": { "mapping": { "loose-key-type": "non-empty-string", "loose-value-type": "input" } }, "inputs-strict": { "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Inputs ids with uppercase letters are converted to lowercase during runtime.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputs)", "mapping": { "loose-key-type": "non-empty-string", "loose-value-type": "input-strict" } }, "input": { "mapping": { "properties": { "default": "input-default-context" }, "loose-key-type": "non-empty-string", "loose-value-type": "any" } }, "input-strict": { "description": "An input parameter for this action.", "mapping": { "properties": { "description": { "type": "string", "description": "A string description of the input parameter.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddescription)" }, "required": { "type": "boolean", "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_idrequired)" }, "default": { "type": "input-default-context", "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault)" }, "deprecationMessage": { "type": "string", "description": "A string shown to users using the deprecated input, warning them that the input is deprecated and mentioning any alternatives.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddeprecationmessage)" } }, "loose-key-type": "non-empty-string", "loose-value-type": "any" } }, "input-default-context": { "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault)", "context": ["github", "strategy", "matrix", "job", "runner", "hashFiles(1,255)"], "string": {} }, "outputs": { "description": "Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions)", "mapping": { "loose-key-type": "non-empty-string", "loose-value-type": "output-definition" } }, "output-definition": { "description": "An output parameter for this action.", "mapping": { "properties": { "description": { "type": "string", "description": "A string description of the output parameter.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription)" }, "value": { "type": "output-value", "description": "The value that the output parameter will be mapped to. You can set this to a string or an expression with context.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_idvalue)" } } } }, "output-value": { "description": "The value that the output parameter will be mapped to. You can set this to a string or an expression with context.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_idvalue)", "context": ["github", "strategy", "matrix", "steps", "inputs", "job", "runner", "env"], "string": {} }, "runs": { "one-of": ["container-runs", "node-runs", "composite-runs", "plugin-runs"] }, "runs-strict": { "description": "Specifies whether this is a JavaScript action, a composite action, or a Docker container action and how the action is executed.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", "one-of": ["container-runs-strict", "node-runs-strict", "composite-runs-strict"] }, "plugin-runs": { "mapping": { "properties": { "plugin": "non-empty-string" } } }, "container-runs": { "mapping": { "properties": { "using": "non-empty-string", "image": "non-empty-string", "entrypoint": "non-empty-string", "args": "container-runs-args", "env": "container-runs-env", "pre-entrypoint": "non-empty-string", "pre-if": "non-empty-string", "post-entrypoint": "non-empty-string", "post-if": "non-empty-string" } } }, "container-runs-args": { "description": "An array of strings that define the inputs for a Docker container. Inputs can include hardcoded strings. GitHub passes the args to the container's ENTRYPOINT when the container starts up.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsargs)", "sequence": { "item-type": "container-runs-context" } }, "container-runs-env": { "description": "Specifies a key/value map of environment variables to set in the container environment.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsenv)", "context": ["inputs"], "mapping": { "loose-key-type": "non-empty-string", "loose-value-type": "string" } }, "container-runs-context": { "context": ["inputs"], "string": {} }, "node-runs": { "mapping": { "properties": { "using": "non-empty-string", "main": "non-empty-string", "pre": "non-empty-string", "pre-if": "non-empty-string", "post": "non-empty-string", "post-if": "non-empty-string" } } }, "composite-runs": { "mapping": { "properties": { "using": "non-empty-string", "steps": "composite-steps" } } }, "container-runs-strict": { "description": "Configuration for Docker container actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", "mapping": { "properties": { "using": { "type": "using", "required": true, "description": "The runtime used to execute the action. Must be docker for Docker container actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsusing)" }, "image": { "type": "non-empty-string", "required": true, "description": "The Docker image to use as the container to run the action. The value can be the Docker base image name, a local Dockerfile in your repository, or a public image in Docker Hub or another registry.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsimage)" }, "entrypoint": { "type": "non-empty-string", "description": "Overrides the Docker ENTRYPOINT in the Dockerfile, or sets it if one wasn't already specified.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsentrypoint)" }, "args": "container-runs-args", "env": "container-runs-env", "pre-entrypoint": { "type": "non-empty-string", "description": "Allows you to run a script before the entrypoint action begins.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre-entrypoint)" }, "pre-if": { "type": "non-empty-string", "description": "Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre-if)" }, "post-entrypoint": { "type": "non-empty-string", "description": "Allows you to run a cleanup script once the runs.entrypoint action has completed.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost-entrypoint)" }, "post-if": { "type": "non-empty-string", "description": "Allows you to define conditions for the post: action execution. The post: action will only run if the conditions in post-if are met. If not set, then post-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost-if)" } } } }, "node-runs-strict": { "description": "Configuration for JavaScript actions executed with Node.js.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", "mapping": { "properties": { "using": { "type": "using", "required": true, "description": "The runtime used to execute the action. Use node20 or node24 for JavaScript actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsusing)" }, "main": { "type": "non-empty-string", "description": "The file that contains your action code. The runtime specified in using executes this file.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsmain)" }, "pre": { "type": "non-empty-string", "description": "Allows you to run a script at the start of a job, before the main: action begins. You can use pre: to run prerequisite setup scripts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre)" }, "pre-if": { "type": "non-empty-string", "description": "Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspre-if)" }, "post": { "type": "non-empty-string", "description": "Allows you to run a script at the end of a job, once the main: action has completed. You can use post: to run cleanup scripts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost)" }, "post-if": { "type": "non-empty-string", "description": "Allows you to define conditions for the post: action execution. The post: action will only run if the conditions in post-if are met. If not set, then post-if defaults to always().\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runspost-if)" } } } }, "composite-runs-strict": { "description": "Configuration for composite actions that run multiple steps.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runs)", "mapping": { "properties": { "using": { "type": "using", "required": true, "description": "The runtime used to execute the action. Must be composite for composite actions.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsusing)" }, "steps": { "type": "composite-steps", "required": true } } } }, "composite-steps": { "description": "The steps that you plan to run in this action. These can be either run steps or uses steps.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runssteps)", "sequence": { "item-type": "composite-step" } }, "composite-step": { "description": "A step within a composite action.", "one-of": ["run-step", "uses-step"] }, "run-step": { "description": "Runs a command-line program using the operating system's shell.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsrun)", "mapping": { "properties": { "name": { "type": "string-steps-context", "description": "A name for your step to display on GitHub.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname)" }, "id": { "type": "non-empty-string", "description": "A unique identifier for the step. You can use the id to reference the step in contexts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsid)" }, "if": { "type": "step-if", "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif)" }, "run": { "type": "string-steps-context", "required": true, "description": "The command you want to run. This can be inline or a script in your action repository.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsrun)" }, "shell": { "type": "string-steps-context", "required": true, "description": "The shell where you want to run the command. Any shell supported by the runner can be used. Required if run is set.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsshell)" }, "env": "step-env", "continue-on-error": { "type": "boolean-steps-context", "description": "Prevents the action from failing when a step fails. Set to true to allow the action to pass when this step fails.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepscontinue-on-error)" }, "working-directory": { "type": "string-steps-context", "description": "Specifies the working directory where the command is run.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsworking-directory)" } } } }, "uses-step": { "description": "Runs another action as part of a step in your action.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsuses)", "mapping": { "properties": { "name": { "type": "string-steps-context", "description": "A name for your step to display on GitHub.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname)" }, "id": { "type": "non-empty-string", "description": "A unique identifier for the step. You can use the id to reference the step in contexts.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsid)" }, "if": { "type": "step-if", "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif)" }, "uses": { "type": "non-empty-string", "required": true, "description": "Selects an action to run as part of a step in your action. An action is a reusable unit of code.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsuses)" }, "with": "step-with", "env": "step-env", "continue-on-error": { "type": "boolean-steps-context", "description": "Prevents the action from failing when a step fails. Set to true to allow the action to pass when this step fails.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepscontinue-on-error)" } } } }, "string-steps-context": { "context": ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], "string": {} }, "boolean-steps-context": { "context": ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], "boolean": {} }, "step-env": { "description": "Sets variables for steps to use in the runner environment. You can also set variables for the entire action.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsenv)", "context": ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], "mapping": { "loose-key-type": "non-empty-string", "loose-value-type": "string" } }, "step-if": { "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif)", "context": ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "always(0,0)", "failure(0,0)", "cancelled(0,0)", "success(0,0)", "hashFiles(1,255)"], "string": {} }, "step-with": { "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith)", "context": ["github", "inputs", "strategy", "matrix", "steps", "job", "runner", "env", "hashFiles(1,255)"], "mapping": { "loose-key-type": "non-empty-string", "loose-value-type": "string" } }, "branding": { "description": "You can use a color and Feather icon to create a badge to personalize and distinguish your action in GitHub Marketplace.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#branding)", "mapping": { "properties": { "icon": { "type": "branding-icon", "description": "The name of the v4.28.0 Feather icon to use.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon)" }, "color": { "type": "branding-color", "description": "The background color of the badge.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor)" } } } }, "branding-icon": { "description": "The name of the v4.28.0 Feather icon to use. Brand icons are omitted as well as: coffee, columns, divide-circle, divide-square, divide, frown, hexagon, key, meh, mouse-pointer, smile, tool, x-octagon.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon)", "allowed-values": ["activity", "airplay", "alert-circle", "alert-octagon", "alert-triangle", "align-center", "align-justify", "align-left", "align-right", "anchor", "aperture", "archive", "arrow-down-circle", "arrow-down-left", "arrow-down-right", "arrow-down", "arrow-left-circle", "arrow-left", "arrow-right-circle", "arrow-right", "arrow-up-circle", "arrow-up-left", "arrow-up-right", "arrow-up", "at-sign", "award", "bar-chart-2", "bar-chart", "battery-charging", "battery", "bell-off", "bell", "bluetooth", "bold", "book-open", "book", "bookmark", "box", "briefcase", "calendar", "camera-off", "camera", "cast", "check-circle", "check-square", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-down", "chevrons-left", "chevrons-right", "chevrons-up", "circle", "clipboard", "clock", "cloud-drizzle", "cloud-lightning", "cloud-off", "cloud-rain", "cloud-snow", "cloud", "code", "command", "compass", "copy", "corner-down-left", "corner-down-right", "corner-left-down", "corner-left-up", "corner-right-down", "corner-right-up", "corner-up-left", "corner-up-right", "cpu", "credit-card", "crop", "crosshair", "database", "delete", "disc", "dollar-sign", "download-cloud", "download", "droplet", "edit-2", "edit-3", "edit", "external-link", "eye-off", "eye", "fast-forward", "feather", "file-minus", "file-plus", "file-text", "file", "film", "filter", "flag", "folder-minus", "folder-plus", "folder", "gift", "git-branch", "git-commit", "git-merge", "git-pull-request", "globe", "grid", "hard-drive", "hash", "headphones", "heart", "help-circle", "home", "image", "inbox", "info", "italic", "layers", "layout", "life-buoy", "link-2", "link", "list", "loader", "lock", "log-in", "log-out", "mail", "map-pin", "map", "maximize-2", "maximize", "menu", "message-circle", "message-square", "mic-off", "mic", "minimize-2", "minimize", "minus-circle", "minus-square", "minus", "monitor", "moon", "more-horizontal", "more-vertical", "move", "music", "navigation-2", "navigation", "octagon", "package", "paperclip", "pause-circle", "pause", "percent", "phone-call", "phone-forwarded", "phone-incoming", "phone-missed", "phone-off", "phone-outgoing", "phone", "pie-chart", "play-circle", "play", "plus-circle", "plus-square", "plus", "pocket", "power", "printer", "radio", "refresh-ccw", "refresh-cw", "repeat", "rewind", "rotate-ccw", "rotate-cw", "rss", "save", "scissors", "search", "send", "server", "settings", "share-2", "share", "shield-off", "shield", "shopping-bag", "shopping-cart", "shuffle", "sidebar", "skip-back", "skip-forward", "slash", "sliders", "smartphone", "speaker", "square", "star", "stop-circle", "sun", "sunrise", "sunset", "tablet", "tag", "target", "terminal", "thermometer", "thumbs-down", "thumbs-up", "toggle-left", "toggle-right", "trash-2", "trash", "trending-down", "trending-up", "triangle", "truck", "tv", "type", "umbrella", "underline", "unlock", "upload-cloud", "upload", "user-check", "user-minus", "user-plus", "user-x", "user", "users", "video-off", "video", "voicemail", "volume-1", "volume-2", "volume-x", "volume", "watch", "wifi-off", "wifi", "wind", "x-circle", "x-square", "x", "zap-off", "zap", "zoom-in", "zoom-out"] }, "branding-color": { "description": "The background color of the badge.\n\n[Documentation](https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor)", "allowed-values": ["white", "yellow", "blue", "green", "orange", "red", "purple", "gray-dark"] }, "using": { "description": "The runtime used to execute the action.", "allowed-values": ["docker", "node12", "node16", "node20", "node24", "composite"] }, "non-empty-string": { "string": { "require-non-empty": true } } } }
@@ -0,0 +1,2 @@
1
+ export declare const ACTION_ROOT = "action-root-strict";
2
+ //# sourceMappingURL=action-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-constants.d.ts","sourceRoot":"","sources":["../../src/actions/action-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const ACTION_ROOT = "action-root-strict";
2
+ //# sourceMappingURL=action-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-constants.js","sourceRoot":"","sources":["../../src/actions/action-constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { TemplateParseResult } from "../templates/template-parse-result.js";
2
+ import { TemplateContext } from "../templates/template-context.js";
3
+ import { TraceWriter } from "../templates/trace-writer.js";
4
+ import { File } from "../workflows/file.js";
5
+ /**
6
+ * Parses an action.yml file and validates it against the action schema.
7
+ * Returns a TemplateParseResult containing the parsed template token tree
8
+ * and any validation errors found during parsing.
9
+ */
10
+ export declare function parseAction(entryFile: File, trace: TraceWriter): TemplateParseResult;
11
+ export declare function parseAction(entryFile: File, context: TemplateContext): TemplateParseResult;
12
+ //# sourceMappingURL=action-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-parser.d.ts","sourceRoot":"","sources":["../../src/actions/action-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAC,eAAe,EAA2B,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,IAAI,EAAC,MAAM,sBAAsB,CAAC;AAK1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;AACtF,wBAAgB,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { TemplateContext, TemplateValidationErrors } from "../templates/template-context.js";
2
+ import * as templateReader from "../templates/template-reader.js";
3
+ import { YamlObjectReader } from "../workflows/yaml-object-reader.js";
4
+ import { ACTION_ROOT } from "./action-constants.js";
5
+ import { getActionSchema } from "./action-schema.js";
6
+ export function parseAction(entryFile, contextOrTrace) {
7
+ const context = contextOrTrace instanceof TemplateContext
8
+ ? contextOrTrace
9
+ : new TemplateContext(new TemplateValidationErrors(), getActionSchema(), contextOrTrace);
10
+ const fileId = context.getFileId(entryFile.name);
11
+ const reader = new YamlObjectReader(fileId, entryFile.content);
12
+ if (reader.errors.length > 0) {
13
+ // The file is not valid YAML, template errors could be misleading
14
+ for (const err of reader.errors) {
15
+ context.error(fileId, err.message, err.range);
16
+ }
17
+ return {
18
+ context,
19
+ value: undefined
20
+ };
21
+ }
22
+ const result = templateReader.readTemplate(context, ACTION_ROOT, reader, fileId);
23
+ return {
24
+ context,
25
+ value: result
26
+ };
27
+ }
28
+ //# sourceMappingURL=action-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-parser.js","sourceRoot":"","sources":["../../src/actions/action-parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAE,wBAAwB,EAAC,MAAM,kCAAkC,CAAC;AAC3F,OAAO,KAAK,cAAc,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AASnD,MAAM,UAAU,WAAW,CAAC,SAAe,EAAE,cAA6C;IACxF,MAAM,OAAO,GACX,cAAc,YAAY,eAAe;QACvC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,wBAAwB,EAAE,EAAE,eAAe,EAAE,EAAE,cAAc,CAAC,CAAC;IAE7F,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,kEAAkE;QAClE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE;YAC/B,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;SAC/C;QACD,OAAO;YACL,OAAO;YACP,KAAK,EAAE,SAAS;SACjB,CAAC;KACH;IACD,MAAM,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjF,OAA4B;QAC1B,OAAO;QACP,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TemplateSchema } from "../templates/schema/index.js";
2
+ /**
3
+ * Returns the action.yml schema, lazily loading and caching it on first access.
4
+ * The schema defines the structure and validation rules for action manifest files.
5
+ */
6
+ export declare function getActionSchema(): TemplateSchema;
7
+ //# sourceMappingURL=action-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-schema.d.ts","sourceRoot":"","sources":["../../src/actions/action-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAK5D;;;GAGG;AACH,wBAAgB,eAAe,IAAI,cAAc,CAMhD"}
@@ -0,0 +1,16 @@
1
+ import { JSONObjectReader } from "../templates/json-object-reader.js";
2
+ import { TemplateSchema } from "../templates/schema/index.js";
3
+ import ActionSchema from "../action-v1.0.min.json";
4
+ let schema;
5
+ /**
6
+ * Returns the action.yml schema, lazily loading and caching it on first access.
7
+ * The schema defines the structure and validation rules for action manifest files.
8
+ */
9
+ export function getActionSchema() {
10
+ if (schema === undefined) {
11
+ const json = JSON.stringify(ActionSchema);
12
+ schema = TemplateSchema.load(new JSONObjectReader(undefined, json));
13
+ }
14
+ return schema;
15
+ }
16
+ //# sourceMappingURL=action-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-schema.js","sourceRoot":"","sources":["../../src/actions/action-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,YAAY,MAAM,yBAAyB,CAAC;AAEnD,IAAI,MAAsB,CAAC;AAE3B;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC1C,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;KACrE;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { ScalarToken, TemplateToken } from "../templates/tokens/index.js";
2
+ import { TemplateContext } from "../templates/template-context.js";
3
+ import { ErrorPolicy } from "../model/convert.js";
4
+ import { Step } from "../model/workflow-template.js";
5
+ /**
6
+ * Represents a parsed and converted action.yml file
7
+ */
8
+ export type ActionTemplate = {
9
+ name: string;
10
+ description: string;
11
+ author?: string;
12
+ inputs?: ActionInputDefinition[];
13
+ outputs?: ActionOutputDefinition[];
14
+ runs: ActionRuns;
15
+ branding?: ActionBranding;
16
+ };
17
+ /**
18
+ * Represents an input definition from the action.yml inputs section.
19
+ */
20
+ export type ActionInputDefinition = {
21
+ id: string;
22
+ description?: string;
23
+ required?: boolean;
24
+ default?: ScalarToken;
25
+ deprecationMessage?: string;
26
+ };
27
+ /**
28
+ * Represents an output definition from the action.yml outputs section.
29
+ */
30
+ export type ActionOutputDefinition = {
31
+ id: string;
32
+ description?: string;
33
+ value?: ScalarToken;
34
+ };
35
+ /**
36
+ * Union type representing the different ways an action can be executed.
37
+ */
38
+ export type ActionRuns = ActionRunsComposite | ActionRunsNode | ActionRunsDocker;
39
+ /**
40
+ * Configuration for composite actions that execute a sequence of steps.
41
+ */
42
+ export type ActionRunsComposite = {
43
+ using: "composite";
44
+ steps: Step[];
45
+ };
46
+ /**
47
+ * Configuration for JavaScript actions that run in Node.js.
48
+ */
49
+ export type ActionRunsNode = {
50
+ using: "node12" | "node16" | "node20" | "node24";
51
+ main: string;
52
+ pre?: string;
53
+ preIf?: string;
54
+ post?: string;
55
+ postIf?: string;
56
+ };
57
+ /**
58
+ * Configuration for Docker container actions.
59
+ */
60
+ export type ActionRunsDocker = {
61
+ using: "docker";
62
+ image: string;
63
+ preEntrypoint?: string;
64
+ preIf?: string;
65
+ entrypoint?: string;
66
+ postEntrypoint?: string;
67
+ postIf?: string;
68
+ args?: string[];
69
+ env?: Record<string, string>;
70
+ };
71
+ /**
72
+ * Branding configuration for displaying the action in the GitHub Marketplace.
73
+ */
74
+ export type ActionBranding = {
75
+ icon?: string;
76
+ color?: string;
77
+ };
78
+ export type ActionTemplateConverterOptions = {
79
+ /**
80
+ * The error policy to use when converting the action.
81
+ * By default, conversion will be skipped if there are errors in the {@link TemplateContext}.
82
+ */
83
+ errorPolicy?: ErrorPolicy;
84
+ };
85
+ /**
86
+ * Converts a parsed action template token into a typed ActionTemplate
87
+ */
88
+ export declare function convertActionTemplate(context: TemplateContext, root: TemplateToken, options?: ActionTemplateConverterOptions): ActionTemplate;
89
+ //# sourceMappingURL=action-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-template.d.ts","sourceRoot":"","sources":["../../src/actions/action-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,IAAI,EAAC,MAAM,+BAA+B,CAAC;AAGnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,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E,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,aAAa,EACnB,OAAO,CAAC,EAAE,8BAA8B,GACvC,cAAc,CAuDhB"}
@@ -0,0 +1,383 @@
1
+ import { BasicExpressionToken } from "../templates/tokens/index.js";
2
+ import { isBoolean, isMapping, isScalar, isSequence, isString } from "../templates/tokens/type-guards.js";
3
+ import { ErrorPolicy } from "../model/convert.js";
4
+ import { convertToIfCondition } from "../model/converter/if-condition.js";
5
+ /**
6
+ * Converts a parsed action template token into a typed ActionTemplate
7
+ */
8
+ export function convertActionTemplate(context, root, options) {
9
+ const result = {};
10
+ const errorPolicy = options?.errorPolicy ?? ErrorPolicy.ReturnErrorsOnly;
11
+ // Skip conversion if there are parse errors (unless TryConversion is set)
12
+ if (context.errors.getErrors().length > 0 && errorPolicy === ErrorPolicy.ReturnErrorsOnly) {
13
+ return result;
14
+ }
15
+ if (!isMapping(root)) {
16
+ context.error(root, new Error("Action must be a mapping"));
17
+ return result;
18
+ }
19
+ for (const item of root) {
20
+ const key = item.key.assertString("action key");
21
+ switch (key.value) {
22
+ case "name":
23
+ if (isString(item.value)) {
24
+ result.name = item.value.value;
25
+ }
26
+ break;
27
+ case "description":
28
+ if (isString(item.value)) {
29
+ result.description = item.value.value;
30
+ }
31
+ break;
32
+ case "author":
33
+ if (isString(item.value)) {
34
+ result.author = item.value.value;
35
+ }
36
+ break;
37
+ case "inputs":
38
+ result.inputs = convertInputs(context, item.value);
39
+ break;
40
+ case "outputs":
41
+ result.outputs = convertOutputs(context, item.value);
42
+ break;
43
+ case "runs":
44
+ result.runs = convertRuns(context, item.value);
45
+ break;
46
+ case "branding":
47
+ result.branding = convertBranding(context, item.value);
48
+ break;
49
+ }
50
+ }
51
+ return result;
52
+ }
53
+ /**
54
+ * Converts the inputs mapping token into an array of ActionInputDefinition objects.
55
+ */
56
+ function convertInputs(context, token) {
57
+ const inputs = [];
58
+ if (!isMapping(token)) {
59
+ return inputs;
60
+ }
61
+ for (const item of token) {
62
+ const id = item.key.assertString("input id").value;
63
+ const input = { id };
64
+ if (isMapping(item.value)) {
65
+ for (const prop of item.value) {
66
+ const propKey = prop.key.assertString("input property").value;
67
+ switch (propKey) {
68
+ case "description":
69
+ if (isString(prop.value)) {
70
+ input.description = prop.value.value;
71
+ }
72
+ break;
73
+ case "required":
74
+ if (isBoolean(prop.value)) {
75
+ input.required = prop.value.value;
76
+ }
77
+ else if (isString(prop.value)) {
78
+ input.required = prop.value.value === "true";
79
+ }
80
+ break;
81
+ case "default":
82
+ if (isScalar(prop.value)) {
83
+ input.default = prop.value;
84
+ }
85
+ break;
86
+ case "deprecationMessage":
87
+ if (isString(prop.value)) {
88
+ input.deprecationMessage = prop.value.value;
89
+ }
90
+ break;
91
+ }
92
+ }
93
+ }
94
+ inputs.push(input);
95
+ }
96
+ return inputs;
97
+ }
98
+ /**
99
+ * Converts the outputs mapping token into an array of ActionOutputDefinition objects.
100
+ */
101
+ function convertOutputs(context, token) {
102
+ const outputs = [];
103
+ if (!isMapping(token)) {
104
+ return outputs;
105
+ }
106
+ for (const item of token) {
107
+ const id = item.key.assertString("output id").value;
108
+ const output = { id };
109
+ if (isMapping(item.value)) {
110
+ for (const prop of item.value) {
111
+ const propKey = prop.key.assertString("output property").value;
112
+ switch (propKey) {
113
+ case "description":
114
+ if (isString(prop.value)) {
115
+ output.description = prop.value.value;
116
+ }
117
+ break;
118
+ case "value":
119
+ if (isScalar(prop.value)) {
120
+ output.value = prop.value;
121
+ }
122
+ break;
123
+ }
124
+ }
125
+ }
126
+ outputs.push(output);
127
+ }
128
+ return outputs;
129
+ }
130
+ /**
131
+ * Converts the runs mapping token into the appropriate ActionRuns variant based on the 'using' value.
132
+ */
133
+ function convertRuns(context, token) {
134
+ if (!isMapping(token)) {
135
+ return { using: "composite", steps: [] };
136
+ }
137
+ let using;
138
+ let main;
139
+ let image;
140
+ let pre;
141
+ let preIf;
142
+ let post;
143
+ let postIf;
144
+ let preEntrypoint;
145
+ let entrypoint;
146
+ let postEntrypoint;
147
+ let args;
148
+ let env;
149
+ let steps = [];
150
+ for (const item of token) {
151
+ const key = item.key.assertString("runs property").value;
152
+ switch (key) {
153
+ case "using":
154
+ if (isString(item.value)) {
155
+ using = item.value.value;
156
+ }
157
+ break;
158
+ case "main":
159
+ if (isString(item.value)) {
160
+ main = item.value.value;
161
+ }
162
+ break;
163
+ case "image":
164
+ if (isString(item.value)) {
165
+ image = item.value.value;
166
+ }
167
+ break;
168
+ case "pre":
169
+ if (isString(item.value)) {
170
+ pre = item.value.value;
171
+ }
172
+ break;
173
+ case "pre-if":
174
+ if (isString(item.value)) {
175
+ preIf = item.value.value;
176
+ }
177
+ break;
178
+ case "post":
179
+ if (isString(item.value)) {
180
+ post = item.value.value;
181
+ }
182
+ break;
183
+ case "post-if":
184
+ if (isString(item.value)) {
185
+ postIf = item.value.value;
186
+ }
187
+ break;
188
+ case "pre-entrypoint":
189
+ if (isString(item.value)) {
190
+ preEntrypoint = item.value.value;
191
+ }
192
+ break;
193
+ case "entrypoint":
194
+ if (isString(item.value)) {
195
+ entrypoint = item.value.value;
196
+ }
197
+ break;
198
+ case "post-entrypoint":
199
+ if (isString(item.value)) {
200
+ postEntrypoint = item.value.value;
201
+ }
202
+ break;
203
+ case "args":
204
+ if (isSequence(item.value)) {
205
+ args = [];
206
+ for (const arg of item.value) {
207
+ if (isScalar(arg)) {
208
+ args.push(arg.toString());
209
+ }
210
+ }
211
+ }
212
+ break;
213
+ case "env":
214
+ if (isMapping(item.value)) {
215
+ env = {};
216
+ for (const envItem of item.value) {
217
+ const envKey = envItem.key.assertString("env key").value;
218
+ if (isString(envItem.value)) {
219
+ env[envKey] = envItem.value.value;
220
+ }
221
+ }
222
+ }
223
+ break;
224
+ case "steps":
225
+ steps = convertSteps(context, item.value);
226
+ break;
227
+ }
228
+ }
229
+ // Determine the type of runs configuration
230
+ if (using === "composite") {
231
+ return { using: "composite", steps };
232
+ }
233
+ else if (using === "docker" && image) {
234
+ return {
235
+ using: "docker",
236
+ image,
237
+ preEntrypoint,
238
+ preIf,
239
+ entrypoint,
240
+ postEntrypoint,
241
+ postIf,
242
+ args,
243
+ env
244
+ };
245
+ }
246
+ else if ((using === "node12" || using === "node16" || using === "node20" || using === "node24") && main) {
247
+ return {
248
+ using,
249
+ main,
250
+ pre,
251
+ preIf,
252
+ post,
253
+ postIf
254
+ };
255
+ }
256
+ // Default fallback
257
+ return { using: "composite", steps: [] };
258
+ }
259
+ /**
260
+ * Converts a steps sequence token into an array of Step objects for composite actions.
261
+ */
262
+ function convertSteps(context, token) {
263
+ const steps = [];
264
+ if (!isSequence(token)) {
265
+ return steps;
266
+ }
267
+ for (const stepToken of token) {
268
+ if (!isMapping(stepToken)) {
269
+ continue;
270
+ }
271
+ const step = convertStep(context, stepToken);
272
+ if (step) {
273
+ steps.push(step);
274
+ }
275
+ }
276
+ return steps;
277
+ }
278
+ /**
279
+ * Converts a single step mapping token into a Step object.
280
+ * Returns undefined if the step lacks both 'run' and 'uses' properties.
281
+ */
282
+ function convertStep(context, token) {
283
+ let id;
284
+ let name;
285
+ let ifCondition;
286
+ let continueOnError;
287
+ let env;
288
+ let run;
289
+ let uses;
290
+ for (const item of token) {
291
+ const key = item.key.assertString("step property").value;
292
+ switch (key) {
293
+ case "id":
294
+ if (isString(item.value)) {
295
+ id = item.value.value;
296
+ }
297
+ break;
298
+ case "name":
299
+ if (isScalar(item.value)) {
300
+ name = item.value;
301
+ }
302
+ break;
303
+ case "if":
304
+ ifCondition = convertToIfCondition(context, item.value);
305
+ break;
306
+ case "continue-on-error":
307
+ if (isBoolean(item.value)) {
308
+ continueOnError = item.value.value;
309
+ }
310
+ else if (isScalar(item.value)) {
311
+ continueOnError = item.value;
312
+ }
313
+ break;
314
+ case "env":
315
+ if (isMapping(item.value)) {
316
+ env = item.value;
317
+ }
318
+ break;
319
+ case "run":
320
+ if (isScalar(item.value)) {
321
+ run = item.value;
322
+ }
323
+ break;
324
+ case "uses":
325
+ if (isString(item.value)) {
326
+ uses = item.value;
327
+ }
328
+ break;
329
+ // Note: shell, working-directory, and with are valid step properties
330
+ // but not currently tracked in the Step model
331
+ }
332
+ }
333
+ // Default if condition to success() like workflow steps
334
+ const defaultIf = new BasicExpressionToken(undefined, undefined, "success()", undefined, undefined, undefined);
335
+ // Produce Step type (same as workflow steps)
336
+ if (run) {
337
+ return {
338
+ id: id || "",
339
+ name,
340
+ if: ifCondition || defaultIf,
341
+ "continue-on-error": continueOnError,
342
+ env,
343
+ run
344
+ };
345
+ }
346
+ else if (uses) {
347
+ return {
348
+ id: id || "",
349
+ name,
350
+ if: ifCondition || defaultIf,
351
+ "continue-on-error": continueOnError,
352
+ env,
353
+ uses
354
+ };
355
+ }
356
+ return undefined;
357
+ }
358
+ /**
359
+ * Converts the branding mapping token into an ActionBranding object.
360
+ */
361
+ function convertBranding(context, token) {
362
+ const branding = {};
363
+ if (!isMapping(token)) {
364
+ return branding;
365
+ }
366
+ for (const item of token) {
367
+ const key = item.key.assertString("branding property").value;
368
+ switch (key) {
369
+ case "icon":
370
+ if (isString(item.value)) {
371
+ branding.icon = item.value.value;
372
+ }
373
+ break;
374
+ case "color":
375
+ if (isString(item.value)) {
376
+ branding.color = item.value.value;
377
+ }
378
+ break;
379
+ }
380
+ }
381
+ return branding;
382
+ }
383
+ //# sourceMappingURL=action-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-template.js","sourceRoot":"","sources":["../../src/actions/action-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AAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBACxB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;iBACnC;gBACD,MAAM;SACT;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { parseAction } from "./action-parser.js";
2
+ export { getActionSchema } from "./action-schema.js";
3
+ export { ACTION_ROOT } from "./action-constants.js";
4
+ export { ActionTemplate, ActionTemplateConverterOptions, ActionInputDefinition, ActionOutputDefinition, ActionRuns, ActionRunsComposite, ActionRunsNode, ActionRunsDocker, ActionBranding, convertActionTemplate } from "./action-template.js";
5
+ export { Step, ActionStep, RunStep } from "../model/workflow-template.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EACL,cAAc,EACd,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Action parser and schema
2
+ export { parseAction } from "./action-parser.js";
3
+ export { getActionSchema } from "./action-schema.js";
4
+ export { ACTION_ROOT } from "./action-constants.js";
5
+ // Action template types and converter
6
+ export { convertActionTemplate } from "./action-template.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,sCAAsC;AACtC,OAAO,EAUL,qBAAqB,EACtB,MAAM,sBAAsB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,5 +2,6 @@ export { convertWorkflowTemplate } from "./model/convert.js";
2
2
  export { WorkflowTemplate } from "./model/workflow-template.js";
3
3
  export * from "./templates/tokens/type-guards.js";
4
4
  export { NoOperationTraceWriter, TraceWriter } from "./templates/trace-writer.js";
5
+ export { TemplateParseResult } from "./templates/template-parse-result.js";
5
6
  export { parseWorkflow, ParseWorkflowResult } from "./workflows/workflow-parser.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAC,sBAAsB,EAAE,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAC,sBAAsB,EAAE,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,gCAAgC,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAE3D,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAC,sBAAsB,EAAc,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,aAAa,EAAsB,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAE3D,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAC,sBAAsB,EAAc,MAAM,6BAA6B,CAAC;AAEhF,OAAO,EAAC,aAAa,EAAsB,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { TemplateContext } from "./template-context.js";
2
+ import { TemplateToken } from "./tokens/template-token.js";
3
+ /**
4
+ * Result of parsing a template file (workflow or action)
5
+ */
6
+ export interface TemplateParseResult {
7
+ context: TemplateContext;
8
+ value: TemplateToken | undefined;
9
+ }
10
+ //# sourceMappingURL=template-parse-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-parse-result.d.ts","sourceRoot":"","sources":["../../src/templates/template-parse-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=template-parse-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-parse-result.js","sourceRoot":"","sources":["../../src/templates/template-parse-result.ts"],"names":[],"mappings":""}
@@ -1,11 +1,13 @@
1
+ import { TemplateParseResult } from "../templates/template-parse-result.js";
1
2
  import { TemplateContext } from "../templates/template-context.js";
2
- import { TemplateToken } from "../templates/tokens/template-token.js";
3
3
  import { TraceWriter } from "../templates/trace-writer.js";
4
4
  import { File } from "./file.js";
5
- export interface ParseWorkflowResult {
6
- context: TemplateContext;
7
- value: TemplateToken | undefined;
8
- }
9
- export declare function parseWorkflow(entryFile: File, trace: TraceWriter): ParseWorkflowResult;
10
- export declare function parseWorkflow(entryFile: File, context: TemplateContext): ParseWorkflowResult;
5
+ /** @deprecated Use TemplateParseResult instead */
6
+ export type ParseWorkflowResult = TemplateParseResult;
7
+ /**
8
+ * Parses a GitHub Actions workflow YAML file and returns the parsed template result.
9
+ * Validates the workflow against the workflow schema and reports any errors.
10
+ */
11
+ export declare function parseWorkflow(entryFile: File, trace: TraceWriter): TemplateParseResult;
12
+ export declare function parseWorkflow(entryFile: File, context: TemplateContext): TemplateParseResult;
11
13
  //# sourceMappingURL=workflow-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-parser.d.ts","sourceRoot":"","sources":["../../src/workflows/workflow-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAA2B,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,aAAa,EAAC,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAI/B,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;AACxF,wBAAgB,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC"}
1
+ {"version":3,"file":"workflow-parser.d.ts","sourceRoot":"","sources":["../../src/workflows/workflow-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAC,eAAe,EAA2B,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAK/B,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;AACxF,wBAAgB,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-parser.js","sourceRoot":"","sources":["../../src/workflows/workflow-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,wBAAwB,EAAC,MAAM,kCAAkC,CAAC;AAC3F,OAAO,KAAK,cAAc,MAAM,iCAAiC,CAAC;AAIlE,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAQzD,MAAM,UAAU,aAAa,CAAC,SAAe,EAAE,cAA6C;IAC1F,MAAM,OAAO,GACX,cAAc,YAAY,eAAe;QACvC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,wBAAwB,EAAE,EAAE,iBAAiB,EAAE,EAAE,cAAc,CAAC,CAAC;IAE/F,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,IA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MAAM,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,kEAAkE;QAClE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE;YAC/B,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;SAC/C;QACD,OAAO;YACL,OAAO;YACP,KAAK,EAAE,SAAS;SACjB,CAAC;KACH;IACD,MAAM,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnF,OAA4B;QAC1B,OAAO;QACP,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actions/workflow-parser",
3
- "version": "0.3.29",
3
+ "version": "0.3.31",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -36,9 +36,9 @@
36
36
  "clean": "rimraf dist",
37
37
  "format": "prettier --write '**/*.ts'",
38
38
  "format-check": "prettier --check '**/*.ts'",
39
- "lint": "eslint 'src/**/*.ts'",
39
+ "lint": "eslint --max-warnings 0 'src/**/*.ts'",
40
40
  "lint-fix": "eslint --fix 'src/**/*.ts'",
41
- "minify-json": "node ../script/minify-json.js src/workflow-v1.0.json",
41
+ "minify-json": "node ../script/minify-json.js src/workflow-v1.0.json && node ../script/minify-json.js src/action-v1.0.json",
42
42
  "prebuild": "npm run minify-json",
43
43
  "prepublishOnly": "npm run build && npm run test",
44
44
  "pretest": "npm run minify-json",
@@ -48,7 +48,7 @@
48
48
  "watch": "tsc --build tsconfig.build.json --watch"
49
49
  },
50
50
  "dependencies": {
51
- "@actions/expressions": "^0.3.29",
51
+ "@actions/expressions": "^0.3.31",
52
52
  "cronstrue": "^2.21.0",
53
53
  "yaml": "^2.0.0-8"
54
54
  },
@@ -71,5 +71,5 @@
71
71
  "ts-jest": "^29.0.3",
72
72
  "typescript": "^4.8.4"
73
73
  },
74
- "gitHead": "f84e42c1f1a814b36392486088b0aaa069d33f67"
74
+ "gitHead": "56ce46afa6c8dc8f6a5d98f5fc5843ca29d5fbd6"
75
75
  }