diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index dc5022e410d..77e93d7e320 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -498,6 +498,12 @@ "description": "GeoJSON format for representing geographic data.", "url": "http://json.schemastore.org/geojson" }, + { + "name": "GitHub Action", + "description": "YAML schema for GitHub Actions", + "fileMatch": ["action.yml"], + "url": "http://json.schemastore.org/github-action" + }, { "name": "gitlab-ci", "description": "JSON schema for configuring Gitlab CI", diff --git a/src/schemas/json/github-action.json b/src/schemas/json/github-action.json new file mode 100644 index 00000000000..6b3a350ed2a --- /dev/null +++ b/src/schemas/json/github-action.json @@ -0,0 +1,480 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#name", + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#name", + "description": "The name of your action. GitHub displays the name in the Actions tab to help visually identify actions in each job.", + "type": "string" + }, + "author": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#author", + "description": "The name of the action's author.", + "type": "string" + }, + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#description", + "description": "A short description of the action.", + "type": "string" + }, + "inputs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputs", + "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "required": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", + "type": "boolean", + "default": false + }, + "default": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file." + } + }, + "required": [ + "description" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "outputs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#outputs", + "description": "Output parameters allow you to specify the data that subsequent actions can use later in the workflow after the action that defines these outputs has run. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input. Output ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase output ids.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#outputsoutput_id", + "description": "A string identifier to associate with the output. The value of is a map of the output's metadata. The must be a unique identifier within the outputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription", + "description": "A string description of the output parameter.", + "type": "string" + } + }, + "required": [ + "description" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "runs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#runs", + "description": "The command to run when the action executes.", + "type": "object", + "properties": { + "using": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#using", + "description": "The application to use to execute the code specified in main.", + "type": "string", + "enum": [ + "node12", + "docker" + ] + }, + "env": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#env", + "description": "Specifies a key/value map of environment variables to set in the virtual environment.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "main": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#main", + "description": "Required for JavaScript actions: The code file that contains your action code. The application specified with the using syntax will execute this file.", + "type": "string" + }, + "image": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#image", + "description": "Required for container actions: 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, a public docker Hub or registry. To reference a Dockerfile local to your repository, use a path relative to the root of the repository. The application specified with the using syntax will execute this file.", + "type": "string" + }, + "entrypoint": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#entrypoint", + "description": "Optional for container actions: Overrides the Docker ENTRYPOINT in the Dockerfile, or sets it if one wasn't already specified. If an action does not use the runs keyword, the commands in entrypoint will execute. The Docker ENTRYPOINT instruction has a shell form and exec form. The Docker ENTRYPOINT documentation recommends using the exec form of the ENTRYPOINT instruction.", + "type": "string" + }, + "args": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#args", + "description": "Optional for container actions: 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.\nThe args are used in place of the CMD instruction in a Dockerfile. If you use CMD in your Dockerfile, use the guidelines ordered by preference:\n- Document required arguments in the action's README and omit them from the CMD instruction.\n- Use defaults that allow using the action without specifying any args.\n- If the action exposes a --help flag, or something similar, use that as the default to make your action self-documenting.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "using" + ], + "oneOf": [ + { + "properties": { + "using": { + "const": "node12" + }, + "image": { + "not": {} + }, + "entrypoint": { + "not": {} + }, + "args": { + "not": {} + } + }, + "required": [ + "main" + ] + }, + { + "properties": { + "using": { + "const": "docker" + }, + "main": { + "not": {} + } + }, + "required": [ + "image" + ] + } + ], + "additionalProperties": false + }, + "branding": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#branding", + "description": "You can use a color and Feather icon to create a badge to personalize and distinguish your action in GitHub Marketplace. For more information, see \"GitHub Actions in the GitHub Marketplace\" in the GitHub Developer documentation.", + "type": "object", + "properties": { + "color": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#color", + "type": "string", + "enum": [ + "white", + "yellow", + "blue", + "green", + "orange", + "red", + "purple", + "gray-dark" + ] + }, + "icon": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#icon", + "type": "string", + "enum": [ + "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", + "chrome", + "circle", + "clipboard", + "clock", + "cloud-drizzle", + "cloud-lightning", + "cloud-off", + "cloud-rain", + "cloud-snow", + "cloud", + "code", + "codepen", + "codesandbox", + "coffee", + "columns", + "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", + "facebook", + "fast-forward", + "feather", + "figma", + "file-minus", + "file-plus", + "file-text", + "file", + "film", + "filter", + "flag", + "folder-minus", + "folder-plus", + "folder", + "framer", + "frown", + "gift", + "git-branch", + "git-commit", + "git-merge", + "git-pull-request", + "github", + "gitlab", + "globe", + "grid", + "hard-drive", + "hash", + "headphones", + "heart", + "help-circle", + "hexagon", + "home", + "image", + "inbox", + "info", + "instagram", + "italic", + "key", + "layers", + "layout", + "life-buoy", + "link-2", + "link", + "linkedin", + "list", + "loader", + "lock", + "log-in", + "log-out", + "mail", + "map-pin", + "map", + "maximize-2", + "maximize", + "meh", + "menu", + "message-circle", + "message-square", + "mic-off", + "mic", + "minimize-2", + "minimize", + "minus-circle", + "minus-square", + "minus", + "monitor", + "moon", + "more-horizontal", + "more-vertical", + "mouse-pointer", + "move", + "music", + "navigation-2", + "navigation", + "octagon", + "package", + "paperclip", + "pause-circle", + "pause", + "pen-tool", + "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", + "slack", + "slash", + "sliders", + "smartphone", + "smile", + "speaker", + "square", + "star", + "stop-circle", + "sun", + "sunrise", + "sunset", + "tablet", + "tag", + "target", + "terminal", + "thermometer", + "thumbs-down", + "thumbs-up", + "toggle-left", + "toggle-right", + "tool", + "trash-2", + "trash", + "trello", + "trending-down", + "trending-up", + "triangle", + "truck", + "tv", + "twitch", + "twitter", + "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-octagon", + "x-square", + "x", + "youtube", + "zap-off", + "zap", + "zoom-in", + "zoom-out" + ] + } + }, + "additionalProperties": false + } + }, + "required": [ + "name", + "description", + "runs" + ], + "additionalProperties": false +}