🔗 DistBoard @hugoalh ● GitHub ● JSR ● NPM
An ECMAScript module to provide a better and easier way for GitHub Actions to communicate with the runner, and the toolkit for developing GitHub Actions.
This is not the official GitHub Actions toolkit, features are vary.
- Ability to use directly on GitHub Actions with ECMAScript runtime without complex setup.
- Compatible with bundler.
- Full ECMAScript.
Any runtime which support ECMAScript should able to use this; These runtimes are officially supported:
- Environment Variable (Deno:
env) (Optional) - File System - Read (Deno:
read; NodeJS:fs-read) (Optional) - File System - Write (Deno:
write; NodeJS:fs-write) (Optional)
| Type | Name | Path | Description |
|---|---|---|---|
| API | . |
./mod.ts |
Default. |
| API | ./annotation |
./annotation.ts |
Annotation. |
| API | ./command/file |
./command/file.ts |
File command. |
| API | ./command/stdout |
./command/stdout.ts |
StdOut command. |
| API | ./env |
./env.ts |
Environment variable. |
| API | ./input |
./input.ts |
Input. |
| API | ./log |
./log.ts |
Log. |
| API | ./output |
./output.ts |
Output. |
| API | ./problem-matcher |
./problem_matcher.ts |
Problem matcher. |
| API | ./runner |
./runner.ts |
Runner. |
| API | ./state |
./state.ts |
State. |
| API | ./summary |
./summary.ts |
Summary. |
| API | ./utility |
./utility.ts |
Utility. |
| CLI | ./cli |
./cli.ts |
Default. |
Note
- Different runtimes have vary support for the entrypoints, visit the runtime documentation for more information.
- These are not part of the public APIs hence should not be used:
- Benchmark/Test file (e.g.:
example.bench.ts,example.test.ts). - Entrypoint name or path include any underscore prefix (e.g.:
_example.ts,foo/_example.ts). - Identifier/Namespace/Symbol include any underscore prefix (e.g.:
_example,Foo._example).
- Benchmark/Test file (e.g.:
-
function addPATHSubsequent(...paths: readonly string[]): void;
-
function addSecretMask(value: string): void;
-
function enterLogGroup(title?: string): void;
-
function exitLogGroup(): void;
-
function getInput(key: string, options?: GitHubActionsGetParameterOptions & { require?: false; }): string | undefined; function getInput(key: string, options: GitHubActionsGetParameterOptions & { require: true; }): string;
-
function getState(key: string, options?: GitHubActionsGetParameterOptions & { require?: false; }): string | undefined; function getState(key: string, options: GitHubActionsGetParameterOptions & { require: true; }): string;
-
function setEnvSubsequent(key: string, value: StringifiableType): void; function setEnvSubsequent(pairs: KeyValueLike<StringifiableType>): void;
-
function setOutput(key: string, value: StringizableType): void; function setOutput(pairs: KeyValueLike<StringizableType>): void;
-
function setState(key: string, value: StringizableType): void; function setState(pairs: KeyValueLike<StringizableType>): void;
-
function writeDebug(...data: readonly string[]): void;
-
function writeError(data: string, properties?: GitHubActionsAnnotationProperties): void;
-
function writeNotice(data: string, properties?: GitHubActionsAnnotationProperties): void;
-
function writeWarning(data: string, properties?: GitHubActionsAnnotationProperties): void;
Note
- For the full or prettier documentation, can visit via:
-
ghac echo off ghac echo on
-
ghac env clear ghac env optimize ghac env set $Key $Value
-
ghac error $Data [--file $File] [--line $Line] [--column $Column] [--line-end $LineEnd] [--column-end $ColumnEnd] [--title $Title] [--summary $Summary] ghac notice $Data [--file $File] [--line $Line] [--column $Column] [--line-end $LineEnd] [--column-end $ColumnEnd] [--title $Title] [--summary $Summary] ghac warning $Data [--file $File] [--line $Line] [--column $Column] [--line-end $LineEnd] [--column-end $ColumnEnd] [--title $Title] [--summary $Summary]
Argument Type Description columnnumberColumn start of the issue file of the annotation. column-endnumberColumn end of the issue file of the annotation. filestringPath of the issue file of the annotation. linenumberLine start of the issue file of the annotation. line-endnumberLine end of the issue file of the annotation. summarystringSummary of the annotation when the message is too large to display. titlestringTitle of the annotation. -
ghac loggroup exit ghac loggroup enter [$Title]
-
ghac output clear ghac output optimize ghac output set $Key $Value
-
ghac path add ...$Paths ghac path clear ghac path optimize
-
ghac state clear ghac state optimize ghac state set $Key $Value
-
ghac summary clear
-
ghac temp clear
-
writeNotice("Hello, world!"); //=> ::notice::Hello, world!
-
ghac notice 'Hello, world!'