Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Henderson committed Jul 10, 2023
1 parent 4c903e6 commit 6b9ec4a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
input-file: 'package.json'
input-property: 'author.name' # Exp: 'fiddlermikey'
- name: read the variable
- name: Display property value for input-property in input-file
id: write
run: echo "The value for ${{ steps.read.outputs.output-property }} is ${{ steps.read.outputs.output-value }}"

Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Assign workflow properties from json

This action is designed to read a json file and set workflow variables using properties defined in the json file

## Inputs

### `input-property`

**Required** The identifier of the json property to be evaluated

## Outputs

### `output-value`

The value from the json property

## Example usage

```yaml
jobs:
assign-from-json:
runs-on: ubuntu-latest
name: A test job to read a value from json as a variable
steps:
- name: Read a json file
uses: ./
id: read
with:
input-file: 'package.json'
input-property: 'author.name' # Exp: 'fiddlermikey'
- name: Display property value for input-property in input-file
id: write
run: echo "The value for ${{ steps.read.outputs.output-property }} is ${{ steps.read.outputs.output-value }}"

```

0 comments on commit 6b9ec4a

Please sign in to comment.