Skip to content

Commit

Permalink
Release: v0.8.2 (#116)
Browse files Browse the repository at this point in the history
## What's Changed
* Ensure kv parsing returns undefined for empty cases by @sethvargo in
#115


**Full Changelog**:
v0.8.1...d5b91a3
  • Loading branch information
google-github-actions-bot committed Jun 3, 2024
1 parent d5b91a3 commit a15c1b7
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 33 deletions.
29 changes: 17 additions & 12 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/kv.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export declare function joinKVStringForGCloud(input: KVPair, chars?: string): st
*
* @param input String with key/value pairs to parse.
*/
export declare function parseKVString(input: string): KVPair;
export declare function parseKVString(input: string): KVPair | undefined;
/**
* Read and parse an env var file. If the file contents begin with a curly
* brace, the content is assumed to be JSON and is parsed as JSON. Otherwise,
* the contents are parsed as a subset of YAML.
*
* @param filePath Path to the file on disk to parse.
*/
export declare function parseKVFile(filePath: string): KVPair;
export declare function parseKVFile(filePath: string): KVPair | undefined;
/**
* parseKVJSON parses the given string as a set of key=value pairs expressed as
* JSON. If the input is not valid JSON, it errors. If the keys and values are
Expand All @@ -51,19 +51,19 @@ export declare function parseKVFile(filePath: string): KVPair;
*
* @return List of key=value pairs.
*/
export declare function parseKVJSON(str: string): KVPair;
export declare function parseKVJSON(str: string): KVPair | undefined;
/**
* Read and parse contents of the string as YAML. This is mostly just exposed
* for testing.
*
* @param str YAML content to parse as K=V pairs.
*/
export declare function parseKVYAML(str: string): KVPair;
export declare function parseKVYAML(str: string): KVPair | undefined;
/**
* parseKVStringAndFile parses the given KV string and KV file, merging the
* results (with kvString taking precedence).
*
* @param kvString String of KEY=VALUE pairs.
* @param kvFilePath Path on disk to a YAML file of KEY: VALUE pairs.
*/
export declare function parseKVStringAndFile(kvString?: string, kvFilePath?: string): KVPair;
export declare function parseKVStringAndFile(kvString?: string, kvFilePath?: string): KVPair | undefined;
4 changes: 2 additions & 2 deletions docs/kv/functions/parseKVFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Function: parseKVFile()

> **parseKVFile**(`filePath`): [`KVPair`](../type-aliases/KVPair.md)
> **parseKVFile**(`filePath`): [`KVPair`](../type-aliases/KVPair.md) \| `undefined`
Read and parse an env var file. If the file contents begin with a curly
brace, the content is assumed to be JSON and is parsed as JSON. Otherwise,
Expand All @@ -20,7 +20,7 @@ Path to the file on disk to parse.

## Returns

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

## Source

Expand Down
4 changes: 2 additions & 2 deletions docs/kv/functions/parseKVJSON.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Function: parseKVJSON()

> **parseKVJSON**(`str`): [`KVPair`](../type-aliases/KVPair.md)
> **parseKVJSON**(`str`): [`KVPair`](../type-aliases/KVPair.md) \| `undefined`
parseKVJSON parses the given string as a set of key=value pairs expressed as
JSON. If the input is not valid JSON, it errors. If the keys and values are
Expand All @@ -24,7 +24,7 @@ JSON string to parse.

## Returns

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

List of key=value pairs.

Expand Down
4 changes: 2 additions & 2 deletions docs/kv/functions/parseKVString.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Function: parseKVString()

> **parseKVString**(`input`): [`KVPair`](../type-aliases/KVPair.md)
> **parseKVString**(`input`): [`KVPair`](../type-aliases/KVPair.md) \| `undefined`
parseKVString parses a string of the format "KEY1=VALUE1,KEY2=VALUE2" or
"KEY1=VALUE1\nKEY2=VALUE2". Keys or values that contain a separator must be
Expand All @@ -24,7 +24,7 @@ String with key/value pairs to parse.

## Returns

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

## Source

Expand Down
6 changes: 3 additions & 3 deletions docs/kv/functions/parseKVStringAndFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Function: parseKVStringAndFile()

> **parseKVStringAndFile**(`kvString`?, `kvFilePath`?): [`KVPair`](../type-aliases/KVPair.md)
> **parseKVStringAndFile**(`kvString`?, `kvFilePath`?): [`KVPair`](../type-aliases/KVPair.md) \| `undefined`
parseKVStringAndFile parses the given KV string and KV file, merging the
results (with kvString taking precedence).
Expand All @@ -23,8 +23,8 @@ Path on disk to a YAML file of KEY: VALUE pairs.

## Returns

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

## Source

[kv.ts:273](https://github.com/google-github-actions/actions-utils/blob/main/src/kv.ts#L273)
[kv.ts:284](https://github.com/google-github-actions/actions-utils/blob/main/src/kv.ts#L284)
6 changes: 3 additions & 3 deletions docs/kv/functions/parseKVYAML.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Function: parseKVYAML()

> **parseKVYAML**(`str`): [`KVPair`](../type-aliases/KVPair.md)
> **parseKVYAML**(`str`): [`KVPair`](../type-aliases/KVPair.md) \| `undefined`
Read and parse contents of the string as YAML. This is mostly just exposed
for testing.
Expand All @@ -19,8 +19,8 @@ YAML content to parse as K=V pairs.

## Returns

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

## Source

[kv.ts:246](https://github.com/google-github-actions/actions-utils/blob/main/src/kv.ts#L246)
[kv.ts:250](https://github.com/google-github-actions/actions-utils/blob/main/src/kv.ts#L250)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@google-github-actions/actions-utils",
"version": "0.8.1",
"version": "0.8.2",
"description": "Helpers and utilities that are shared among Google GitHub Actions",
"author": "Google LLC",
"license": "Apache-2.0",
Expand Down

0 comments on commit a15c1b7

Please sign in to comment.