# Link Checker

Check website for broken links using LinkChecker.

## YAML Parameters

```typescript
interface YAMLParameters {
  /** The address of the site to be checked by the validator. */
  scan_url: string;
  type: "LINK_CHECKER";
  /** Unique identifier for the action within the pipeline. */
  action: string;
  /** The basic auth username value. */
  ba_username?: string;
  /** The basic auth password value. */
  ba_password?: string;
  /** Set the cookie name/value. Can be given more than once. */
  cookies?: CookieYaml[];
  /** Generate no more than the given number of threads. The default number of threads is 10. To disable threading specify a non-positive number. */
  threads?: number;
  /** Check recursively all links up to the given depth. A negative depth will enable infinite recursion. The default depth is infinite. */
  depth?: number;
  /** Set the timeout for connection attempts in seconds. The default timeout is 60 seconds. */
  connection_timeout?: number;
  /** Specify the User-Agent string to send to the HTTP server, for example `Mozilla/4.0`. The default is `LinkChecker/X.Y` where X.Y is the current version of LinkChecker. */
  user_agent?: string;
  /** Limit the maximum number of HTTP requests per second to one host. The average number of requests per second is approximately one third of the maximum. Values less than 1 and at least 0.001 can be used. To use values greater than 10, the HTTP server must return a "LinkChecker" response header. The default is 10. */
  requests_per_host?: number;
  /** When using HTTP, fetch robots.txt, and confirm whether each URL should be accessed before checking. The default is to use robots.txt files. */
  respect_robot_exclusions?: boolean;
  /** If set to zero, it disables the SSL certificate checking. If set to one, it enables the SSL certificate checking with the provided CA certificate file. If a filename is specified, it will be used as the certificate file. */
  check_ssl_certificate?: boolean;
  /** The regular expression to add more URLs recognized as internal links. The default is that URLs given on the command line are internal. */
  internal_links?: string;
  /** Check external links. The default is to check internal links only. */
  check_external_links?: boolean;
  /** Only check the syntax of URLs matching the given regular expressions. */
  ignore_urls?: string[];
  /** Check but do not recurse into URLs matching the given regular expressions. */
  no_follow_urls?: string[];
  /** Only check syntax of URLs matching the given regular expressions. */
  warning_regex?: string;
  /** The name attribute of the username input element. */
  html_form_auth_username_input_name?: string;
  /** The name attribute of the password input element. */
  html_form_auth_password_input_name?: string;
  /** The HTML form username value. */
  html_form_auth_username?: string;
  /** The HTML form password value. */
  html_form_auth_password?: string;
  /** The URL of a login page to be visited before link checking. The page is expected to contain an HTML form to collect credentials and submit them to the address in its action attribute using an HTTP POST request. */
  html_form_auth_url?: string;
  /** Specifies when the action should be executed. */
  trigger_time?: "ON_EVERY_EXECUTION" | "ON_FAILURE" | "ON_BACK_TO_SUCCESS" | "ON_WARNING" | "ON_WAIT_FOR_APPROVE" | "ON_TERMINATE";
  /** The list of variables for dynamic action execution. The action runs once for each value. */
  loop?: string[];
  /** Defines whether the action should be executed on each failure. Restricted to and required if the trigger_time is ON_FAILURE. */
  run_only_on_first_failure?: boolean;
  /** When set to true the action is disabled. By default it is set to false. */
  disabled?: boolean;
  /** The timeout in seconds. */
  timeout?: number;
  /** If set to true the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions. */
  ignore_errors?: boolean;
  /** Delay time between auto retries in seconds. */
  retry_interval?: number;
  /** Number of retries if the action fails. */
  retry_count?: number;
  /** Defines whether the action should run in parallel with the next one. */
  run_next?: "WAIT_ON_SUCCESS" | "IN_SOFT_PARALLEL" | "IN_HARD_PARALLEL";
  /** The list of trigger conditions to meet so that the action can be triggered. */
  trigger_conditions?: TriggerConditionYaml[];
  /** The list of variables you can use in the action. */
  variables?: VariableYaml[];
}
```

## Type Definitions

```typescript
interface CookieYaml {
  /** Cookie name */
  name?: string;
  /** Cookie value */
  value?: string;
  /** Cookie host */
  host?: string;
  /** Cookie path */
  path?: string;
}

interface TriggerConditionYaml {
  /** The type of trigger condition */
  trigger_condition: "ALWAYS" | "ON_CHANGE" | "ON_CHANGE_AT_PATH" | "VAR_IS" | "VAR_IS_NOT" | "VAR_CONTAINS" | "VAR_NOT_CONTAINS" | "DATETIME" | "SUCCESS_PIPELINE" | "DAY" | "HOUR" | "OR" | "VAR_LESS_THAN" | "VAR_LESS_THAN_OR_EQUAL" | "VAR_GREATER_THAN" | "VAR_GREATER_THAN_OR_EQUAL" | "ACTION_STATUS_IS" | "ACTION_STATUS_IS_NOT" | "TRIGGERING_USER_IS" | "TRIGGERING_USER_IS_NOT" | "TRIGGERING_USER_IS_IN_GROUP" | "TRIGGERING_USER_IS_NOT_IN_GROUP";
  /** The value to compare the trigger variable against */
  trigger_variable_value?: string;
  /** The name of the variable to check in the trigger condition */
  trigger_variable_key?: string;
  /** The timezone for datetime trigger conditions (e.g., 'UTC', 'Europe/Warsaw') */
  timezone?: string;
  /** The hours when the datetime trigger should activate (0-23) */
  trigger_hours?: number[];
  /** The days when the datetime trigger should activate (1-7, where 1 is Monday) */
  trigger_days?: number[];
  /** The project name for cross-project pipeline triggers */
  project?: string;
  /** The pipeline name for cross-pipeline triggers */
  pipeline?: string;
  /** The username or email of the user who can trigger the pipeline */
  trigger_user?: string;
  /** The name of the group that can trigger the pipeline */
  trigger_group?: string;
  /** The file paths that must change to trigger the pipeline */
  trigger_condition_paths?: string[];
  /** The action status to check for action status triggers */
  trigger_status?: "SUCCESSFUL" | "FAILED" | "SKIPPED" | "SUPPRESSED";
  /** The name of the action to check status for */
  trigger_action_name?: string;
  /** The list of nested trigger conditions for OR/AND operators */
  trigger_operands?: TriggerConditionYaml[];
}

interface VariableYaml {
  /** The name of the variable */
  key: string;
  /** The value of the variable */
  value?: string;
  /** The type of the added variable */
  type?: "VAR" | "FILE" | "SSH_KEY" | "IOS_KEYCHAIN" | "IOS_PROVISION_PROFILES" | "SSH_PUBLIC_KEY" | "GPG_KEY" | "P12";
  /** If set to true the variable value will be encrypted and hidden */
  encrypted?: boolean;
  /** Initial path for the variable */
  init_path?: string;
  /** Default value for the variable */
  defaults?: string;
  /** Specifies where to copy the file on each run. Set if type is FILE, SSH_KEY, IOS_KEYCHAIN, or IOS_PROVISION_PROFILES. */
  file_path?: string;
  /** File permission set on copy to a container on each run. Set if type is FILE, SSH_KEY, IOS_KEYCHAIN, or IOS_PROVISION_PROFILES. */
  file_chmod?: string;
  /** Set if type is FILE, SSH_KEY, IOS_KEYCHAIN, or IOS_PROVISION_PROFILES. If it's NONE, the variable can be used as a parameter in an action. For CONTAINER, the given key is additionally copied to an action container on each run */
  file_place?: "NONE" | "CONTAINER";
  /** Password for certificates */
  password?: string;
  /** Passphrase for encrypted SSH keys */
  passphrase?: string;
  /** Key identifier for iOS certificates, provisioning profiles, or GPG keys */
  key_identifier?: string;
  /** If set to true the variable value can be set by Buddy actions */
  settable?: string;
  /** If set to true the variable is disabled and will not be injected anywhere */
  disabled?: boolean;
  /** Encoding of the variable value. Use `b64` for binary files (certificates, images, compiled blobs) where the value is already base64-encoded. Omit or set to `text` for plain text files (JSON, XML, config) — the system will handle encoding automatically. Only applies to non-encrypted asset variables (FILE, SSH_KEY, SSH_PUBLIC_KEY, IOS_KEYCHAIN, IOS_PROVISION_PROFILES). */
  encoding?: "text" | "b64";
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
}

```

## YAML Examples

### Check broken links with options

```yaml
- action: "Check broken links"
  type: "LINK_CHECKER"
  trigger_time: "ON_EVERY_EXECUTION"
  scan_url: "https://example.com"
  threads: 5
  depth: 3
  connection_timeout: 30
  check_external_links: true
  check_ssl_certificate: true
  respect_robot_exclusions: true

```


---
Original source: https://buddy.works/docs/yaml/yaml-actions/link-checker