Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **getGlobalWacContext**(): [`Context`](../interfaces/Context.md) \| `undefined`

Defined in: [types/context.ts:22](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/context.ts#L22)
Defined in: [types/context.ts:22](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/context.ts#L22)

## Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

# Interface: Context

Defined in: [types/context.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/context.ts#L3)
Defined in: [types/context.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/context.ts#L3)

## Properties

### diagnosticRules?

> `optional` **diagnosticRules**: [`DiagnosticRules`](../../Diagnostics/type-aliases/DiagnosticRules.md)
> `optional` **diagnosticRules?**: [`DiagnosticRules`](../../Diagnostics/type-aliases/DiagnosticRules.md)

Defined in: [types/context.ts:6](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/context.ts#L6)
Defined in: [types/context.ts:6](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/context.ts#L6)

Configured diagnostic rules from wac.config.json

Expand All @@ -24,4 +24,4 @@ Configured diagnostic rules from wac.config.json

> **diagnostics**: [`DiagnosticsReporter`](../../Diagnostics/interfaces/DiagnosticsReporter.md)

Defined in: [types/context.ts:4](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/context.ts#L4)
Defined in: [types/context.ts:4](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/context.ts#L4)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **generateStackTrace**(`constructorOpt?`): `string`

Defined in: [types/diagnostics.ts:115](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L115)
Defined in: [types/diagnostics.ts:161](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L161)

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **getEffectiveSeverity**(`diagnostic`, `rules`): [`DiagnosticSeverity`](../type-aliases/DiagnosticSeverity.md) \| `"off"`

Defined in: [types/diagnostics.ts:73](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L73)
Defined in: [types/diagnostics.ts:119](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L119)

Determines the effective severity for a diagnostic based on configured rules.
Returns the severity to use, or 'off' if the diagnostic should be suppressed.
Expand All @@ -21,7 +21,7 @@ Returns the severity to use, or 'off' if the diagnostic should be suppressed.

### rules

[`DiagnosticRules`](../type-aliases/DiagnosticRules.md) | `undefined`
[`DiagnosticRules`](../type-aliases/DiagnosticRules.md) \| `undefined`

## Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **getSuppressions**<`T`>(`val`): `object`[] \| `undefined`

Defined in: [types/diagnostics.ts:205](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L205)
Defined in: [types/diagnostics.ts:253](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L253)

Gets suppression metadata from a value, if present.
Returns undefined if the value is not suppressed.
Expand All @@ -23,7 +23,7 @@ Returns undefined if the value is not suppressed.

### val

`T` | [`SuppressedValue`](../interfaces/SuppressedValue.md)<`T`>
`T` \| [`SuppressedValue`](../interfaces/SuppressedValue.md)<`T`>

## Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **isCodeSuppressed**<`T`>(`val`, `code`): `boolean`

Defined in: [types/diagnostics.ts:217](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L217)
Defined in: [types/diagnostics.ts:265](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L265)

Checks if a diagnostic code is suppressed for a given value.

Expand All @@ -22,7 +22,7 @@ Checks if a diagnostic code is suppressed for a given value.

### val

`T` | [`SuppressedValue`](../interfaces/SuppressedValue.md)<`T`>
`T` \| [`SuppressedValue`](../interfaces/SuppressedValue.md)<`T`>

### code

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

# Function: isSuppressedValue()

> **isSuppressedValue**&lt;`T`&gt;(`val`): `val is SuppressedValue<T>`
> **isSuppressedValue**&lt;`T`&gt;(`val`): `val is SuppressedValue&lt;T&gt;`

Defined in: [types/diagnostics.ts:180](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L180)
Defined in: [types/diagnostics.ts:228](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L228)

Type guard to check if a value is a SuppressedValue.

Expand All @@ -22,8 +22,8 @@ Type guard to check if a value is a SuppressedValue.

### val

`T` | [`SuppressedValue`](../interfaces/SuppressedValue.md)&lt;`T`&gt;
`T` \| [`SuppressedValue`](../interfaces/SuppressedValue.md)&lt;`T`&gt;

## Returns

`val is SuppressedValue<T>`
`val is SuppressedValue&lt;T&gt;`
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **matchesActionPattern**(`action`, `pattern`): `boolean`

Defined in: [types/diagnostics.ts:61](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L61)
Defined in: [types/diagnostics.ts:107](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L107)

Checks if an action string matches a pattern.
Supports wildcard (*) at the end of patterns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **suppress**&lt;`T`&gt;(`value`, `codes`, `reason?`): [`SuppressedValue`](../interfaces/SuppressedValue.md)&lt;`T`&gt;

Defined in: [types/diagnostics.ts:164](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L164)
Defined in: [types/diagnostics.ts:212](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L212)

Wraps a value with diagnostic suppression metadata.
Use this to suppress specific warnings for a value in-code.
Expand All @@ -29,9 +29,9 @@ The value to wrap

### codes

Diagnostic code(s) to suppress (e.g., 'action-version-semver-violation')
`string` \| `string`[]

`string` | `string`[]
Diagnostic code(s) to suppress (e.g., 'action-version-semver-violation')

### reason?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **unwrapValue**&lt;`T`&gt;(`val`): `T`

Defined in: [types/diagnostics.ts:194](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L194)
Defined in: [types/diagnostics.ts:242](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L242)

Unwraps a potentially suppressed value, returning the underlying value.

Expand All @@ -22,7 +22,7 @@ Unwraps a potentially suppressed value, returning the underlying value.

### val

`T` | [`SuppressedValue`](../interfaces/SuppressedValue.md)&lt;`T`&gt;
`T` \| [`SuppressedValue`](../interfaces/SuppressedValue.md)&lt;`T`&gt;

## Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,97 @@

# Interface: Diagnostic

Defined in: [types/diagnostics.ts:39](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L39)
Defined in: [types/diagnostics.ts:39](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L39)

## Properties

### action?

> `optional` **action**: `string`
> `optional` **action?**: `string`

Defined in: [types/diagnostics.ts:46](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L46)
Defined in: [types/diagnostics.ts:92](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L92)

Optional action identifier for pattern matching (e.g., "actions/checkout@v4")
Optional action identifier for pattern matching (e.g., "actions/checkout@v4").

End users may specify an exclude pattern for a diagnostic code. This is
checked against the diagnostics "action" property, and if it matches, the
diagnostic will be supressed.

This value should be provided if the diagnostic event relates to a specific
action. Otherwise, it can be omitted.

***

### cause?

> `optional` **cause**: `Error`
> `optional` **cause?**: `Error`

Defined in: [types/diagnostics.ts:81](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L81)

Defined in: [types/diagnostics.ts:44](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L44)
An optional cause for the diagnostic event. If provided, the default
diagnostics reporter implementation will log this below the diagnostic
message.

***

### code

> **code**: `string`

Defined in: [types/diagnostics.ts:41](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L41)
Defined in: [types/diagnostics.ts:52](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L52)

The unique code for the diagnostic rule. This should be a unique kebab-case
string. It will be displayed to the user alongside the diagnostic message,
and can be used by end users to override the severity of the diagnostic
event.

#### Example

```ts
"my-custom-diagnostic-code"
```

***

### message

> **message**: `string`

Defined in: [types/diagnostics.ts:42](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L42)
Defined in: [types/diagnostics.ts:56](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L56)

A short message explaining the error.

***

### severity

> **severity**: [`DiagnosticSeverity`](../type-aliases/DiagnosticSeverity.md)

Defined in: [types/diagnostics.ts:40](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L40)
Defined in: [types/diagnostics.ts:43](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L43)

The severity of the diagnostic event.

***

### stack?

> `optional` **stack**: `string`
> `optional` **stack?**: `string`

Defined in: [types/diagnostics.ts:75](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L75)

The stack trace for the diagnostic event. This can be produced using the
`Diagnostics.generateStackTrace` helper:

```ts
import { Diagnostics } from '@github-actions-workflow-ts/lib'

export class MyCustomAction {
constructor(...) {
Diagnostics.generateStackTrace(this.constructor)
}
}
```

Defined in: [types/diagnostics.ts:43](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L43)
Note that `Diagnostics.generateStackTrace` accepts an optional function
argument. If provided, the top frame of the stack trace will be the call
site of that function.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

# Interface: DiagnosticsReporter

Defined in: [types/diagnostics.ts:49](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L49)
Defined in: [types/diagnostics.ts:95](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L95)

## Methods

### emit()

> **emit**(`d`): `void`

Defined in: [types/diagnostics.ts:50](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L50)
Defined in: [types/diagnostics.ts:96](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L96)

#### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Interface: SuppressedValue&lt;T&gt;

Defined in: [types/diagnostics.ts:136](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L136)
Defined in: [types/diagnostics.ts:184](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L184)

A value wrapped with diagnostic suppression metadata.
Created by the `suppress()` function.
Expand All @@ -23,28 +23,28 @@ Created by the `suppress()` function.

> **\[SUPPRESSED\_VALUE\_SYMBOL\]**: `true`

Defined in: [types/diagnostics.ts:137](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L137)
Defined in: [types/diagnostics.ts:185](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L185)

***

### suppressions

> **suppressions**: `object`[]

Defined in: [types/diagnostics.ts:139](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L139)
Defined in: [types/diagnostics.ts:187](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L187)

#### code

> **code**: `string`

#### reason?

> `optional` **reason**: `string`
> `optional` **reason?**: `string`

***

### value

> **value**: `T`

Defined in: [types/diagnostics.ts:138](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L138)
Defined in: [types/diagnostics.ts:186](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L186)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **ConfiguredSeverity** = `"off"` \| `"warn"` \| `"error"`

Defined in: [types/diagnostics.ts:21](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L21)
Defined in: [types/diagnostics.ts:21](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L21)

Configured severity level for diagnostic rules.
- 'off': Suppress the diagnostic entirely
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **DiagnosticRuleConfig** = [`ConfiguredSeverity`](ConfiguredSeverity.md) \| \{ `exclude?`: `string`[]; `severity?`: [`ConfiguredSeverity`](ConfiguredSeverity.md); \}

Defined in: [types/diagnostics.ts:27](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L27)
Defined in: [types/diagnostics.ts:27](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L27)

Configuration for a diagnostic rule.
Can be a simple severity string or an object with more options.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

> **DiagnosticRules** = `Record`&lt;`string`, [`DiagnosticRuleConfig`](DiagnosticRuleConfig.md)&gt;

Defined in: [types/diagnostics.ts:37](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L37)
Defined in: [types/diagnostics.ts:37](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L37)

Map of diagnostic codes to their rule configurations.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

> **DiagnosticSeverity** = *typeof* [`DiagnosticSeverity`](../variables/DiagnosticSeverity.md)\[keyof *typeof* [`DiagnosticSeverity`](../variables/DiagnosticSeverity.md)\]

Defined in: [types/diagnostics.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L3)
Defined in: [types/diagnostics.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L3)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> `const` **DiagnosticSeverity**: `object`

Defined in: [types/diagnostics.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/diagnostics.ts#L3)
Defined in: [types/diagnostics.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/diagnostics.ts#L3)

## Type Declaration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

> **MatrixConfiguration** = `string` \| \[[`Configuration`](../../GeneratedWorkflowTypes/type-aliases/Configuration.md), `...Configuration[]`\]

Defined in: [types/githubActionsWorkflowExtended.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/eb791f98a5c7871cf5c52fc4e1567bf9fe1afcd1/packages/lib/src/types/githubActionsWorkflowExtended.ts#L3)
Defined in: [types/githubActionsWorkflowExtended.ts:3](https://github.com/emmanuelnk/github-actions-workflow-ts/blob/204cfff36f251549b6101484013006e38b3d20bf/packages/lib/src/types/githubActionsWorkflowExtended.ts#L3)
Loading
Loading