Skip to content

Commit d777782

Browse files
committedJun 18, 2024
Decrease non-existent input file/directory from an Error to a Warning
1 parent 33fab0a commit d777782

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed
 

‎.github/workflows/main.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
with:
1414
out-file: output.json
1515

16-
- name: xxx
16+
- name: Check output file presence
1717
shell: bash
1818
run: |
1919
if [ -f 'output.json' ]; then
@@ -22,6 +22,19 @@ jobs:
2222
else
2323
echo "No output file"
2424
fi
25+
non_exist:
26+
runs-on: ubuntu-latest
27+
name: Test with non-existent file and directory on input
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Test
33+
uses: ./
34+
with:
35+
in-file: asdf_file
36+
in-directory: asdf_dir
37+
out-file: output.json
2538

2639
file_to_file:
2740
runs-on: ubuntu-latest

‎index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ try
3939
return;
4040
}
4141
else
42-
core.error("inDirectory " + inDirectory + " does not exist");
42+
core.warning("inDirectory " + inDirectory + " does not exist");
4343
}
4444

4545
// Directory of single-object files
@@ -72,7 +72,7 @@ try
7272
});
7373
}
7474
else
75-
core.error("inDirectory " + inDirectory + " does not exist");
75+
core.warning("inDirectory " + inDirectory + " does not exist");
7676
}
7777

7878
// Output file

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-merge",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Merges multi-object JSON with multiple single-object JSONs",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)