-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Henderson
committed
Jul 10, 2023
1 parent
4c903e6
commit 6b9ec4a
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" | ||
|
||
``` |