Skip to content

Commit 308a20b

Browse files
committed
Add outputs with codename and version
1 parent d6edd7f commit 308a20b

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/main.yml

+14
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,25 @@ jobs:
99
uses: actions/checkout@v4
1010

1111
- name: Test minimal.json
12+
id: minimal_json
1213
uses: ./
1314
with:
1415
file: test/minimal.json
1516

17+
- name: Print minimal.json info
18+
shell: bash
19+
run: |
20+
echo "Codename: ${{steps.minimal_json.outputs.codename}}"
21+
echo "Version: ${{steps.minimal_json.outputs.version}}"
22+
1623
- name: Test full.json
24+
id: full_json
1725
uses: ./
1826
with:
1927
file: test/full.json
28+
29+
- name: Print full.json info
30+
shell: bash
31+
run: |
32+
echo "Codename: ${{steps.full_json.outputs.codename}}"
33+
echo "Version: ${{steps.full_json.outputs.version}}"

action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ inputs:
88
official:
99
description: 'Set to `true` for official plugins, otherwise shows some warning when the plugin looks too official'
1010
default: 'false'
11+
outputs:
12+
codename:
13+
description: 'Plugin codename'
14+
version:
15+
description: 'Plugin version'
1116
runs:
1217
using: 'node20'
1318
main: 'index.js'

index.js

+6
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,20 @@ try
397397
if(!json.hasOwnProperty("codename"))
398398
core.error('Missing `codename`');
399399
else
400+
{
400401
checkCodename(json['codename']);
402+
core.setOutput('codename', json['codename']);
403+
}
401404
}
402405
// version
403406
{
404407
if(!json.hasOwnProperty("version"))
405408
core.error('Missing `version`');
406409
else
410+
{
407411
checkVersion(json['version']);
412+
core.setOutput('version', json['version']);
413+
}
408414
}
409415
// name
410416
{

0 commit comments

Comments
 (0)