Skip to content

Commit 6b9ec4a

Browse files
author
Michael Henderson
committed
Add readme
1 parent 4c903e6 commit 6b9ec4a

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
input-file: 'package.json'
1616
input-property: 'author.name' # Exp: 'fiddlermikey'
17-
- name: read the variable
17+
- name: Display property value for input-property in input-file
1818
id: write
1919
run: echo "The value for ${{ steps.read.outputs.output-property }} is ${{ steps.read.outputs.output-value }}"
2020

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Assign workflow properties from json
2+
3+
This action is designed to read a json file and set workflow variables using properties defined in the json file
4+
5+
## Inputs
6+
7+
### `input-property`
8+
9+
**Required** The identifier of the json property to be evaluated
10+
11+
## Outputs
12+
13+
### `output-value`
14+
15+
The value from the json property
16+
17+
## Example usage
18+
19+
```yaml
20+
jobs:
21+
assign-from-json:
22+
runs-on: ubuntu-latest
23+
name: A test job to read a value from json as a variable
24+
steps:
25+
- name: Read a json file
26+
uses: ./
27+
id: read
28+
with:
29+
input-file: 'package.json'
30+
input-property: 'author.name' # Exp: 'fiddlermikey'
31+
- name: Display property value for input-property in input-file
32+
id: write
33+
run: echo "The value for ${{ steps.read.outputs.output-property }} is ${{ steps.read.outputs.output-value }}"
34+
35+
```

0 commit comments

Comments
 (0)