-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (25 loc) · 836 Bytes
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: Set var from json
on: [push]
jobs:
assign-from-json:
runs-on: ubuntu-latest
name: A test job to read a value from json as a variable
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read a json file
uses: ./
id: read
with:
input-file: 'package.json'
input-property: 'author.name' # Exp: 'fiddlermikey'
- name: Read a json file
uses: ./
id: read-nofail
with:
input-file: 'package.json'
input-property: 'foo' # does not exist
required-value: 'false' # Ignore if not present
- 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 }}"