Skip to content

Commit

Permalink
docs: fill readme with usage guide (#12)
Browse files Browse the repository at this point in the history
* docs(readme): add Key Features section

* docs(readme): add Getting Inputs section

* docs(readme): add Setting Outputs section

* docs(readme): add Logging Errors section

* chore: bump package version to v0.1.0
  • Loading branch information
threeal authored Aug 8, 2024
1 parent da85a33 commit 9a7c7ac
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

A minimalistic utility package for developing [GitHub Actions](https://github.com/features/actions).

## Key Features

- ES Module support.
- Getting inputs and setting outputs.
- Logging errors.

## Usage Guide

### Getting Inputs

GitHub Actions inputs can be retrieved using the `getInput` function, which will return a trimmed string or an empty string if the input is not specified:

```ts
const input = getInput("input-name");
```

### Setting Outputs

GitHub Actions outputs can be set using the `setOutput` function:

```ts
setOutput("output-name", "some value");
```

### Logging Errors

Errors can be logged using the `error` function, which can log errors of any type. This is especially useful for logging caught errors:

```ts
try {
// Do something
} catch (err) {
error(err);
}
```

## License

This project is licensed under the terms of the [MIT License](./LICENSE).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gha-utils",
"version": "0.0.0",
"version": "0.1.0",
"description": "A minimalistic utility package for developing GitHub Actions",
"keywords": [
"github",
Expand Down

0 comments on commit 9a7c7ac

Please sign in to comment.