Skip to content

Commit 81986e8

Browse files
refactor: update template variable syntax to use YAML format (#24)
1 parent 1cb8471 commit 81986e8

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ steps:
5050
run: echo "${{ steps.build-comment.outputs.updated-text }}"
5151
```
5252
53-
### Direct Text (ENV variables)
53+
### Direct Text (YAML variables)
5454
5555
```yaml
5656
steps:
@@ -60,7 +60,7 @@ steps:
6060
with:
6161
template-text: 'Hello {{ login }}, nice to meet you!'
6262
template-vars: |
63-
login=${{ github.actor }}
63+
login: ${{ github.actor }}
6464
6565
- name: Do something with result
6666
run: echo "${{ steps.build-comment.outputs.updated-text }}"

examples/direct-text.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ jobs:
1616
uses: skills/action-text-variables@v1
1717
with:
1818
template-text: 'Hello {{ login }}, nice to meet you! Have you met my friend {{ friend }}?'
19-
template-vars: '{
20-
"login": "${{ github.actor }}",
21-
"friend": "Mona"
22-
}'
19+
template-vars: >
20+
{
21+
"login": "${{ github.actor }}",
22+
"friend": "Mona"
23+
}
2324
2425
- name: Do something with result
2526
run: echo "${{ steps.build-comment.outputs.updated-text }}"
@@ -38,8 +39,8 @@ jobs:
3839
with:
3940
template-text: 'Hello {{ login }}, nice to meet you! Have you met my friend {{ friend }}?'
4041
template-vars: |
41-
login=${{ github.actor }}
42-
friend=Mona
42+
login: ${{ github.actor }}
43+
friend: Mona
4344
4445
- name: Do something with result
4546
run: echo "${{ steps.build-comment.outputs.updated-text }}"

examples/template-from-other-repo.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ jobs:
2525
uses: skills/action-text-variables@v1
2626
with:
2727
template-file: response-templates/step-feedback/lesson-finished.md
28-
template-vars: '{
28+
template-vars: >
29+
{
2930
"login": "${{ github.actor }}",
3031
"repo_full_name": "${{ github.repository }}"
31-
}'
32+
}
3233
3334
- name: Do something with result
3435
run: echo "${{ steps.build-comment.outputs.updated-text }}"

examples/template-from-same-repo.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ jobs:
1919
uses: skills/action-text-variables@v1
2020
with:
2121
template-file: examples/hello.md
22-
template-vars: '{"login": "${{ github.actor }}" }'
22+
template-vars: >
23+
{
24+
"login": "${{ github.actor }}"
25+
}
2326
2427
- name: Do something with result
2528
run: echo "${{ steps.build-comment.outputs.updated-text }}"

0 commit comments

Comments
 (0)