@@ -11,7 +11,7 @@ import * as assert from "assert";
1111
1212describe ( "util" , ( ) => {
1313 describe ( "uploadUrl" , ( ) => {
14- it ( "stripts template" , ( ) => {
14+ it ( "strips template" , ( ) => {
1515 assert . equal (
1616 uploadUrl (
1717 "https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}"
@@ -95,21 +95,33 @@ describe("util", () => {
9595 } ) ;
9696 describe ( "parseConfig" , ( ) => {
9797 it ( "parses basic config" , ( ) => {
98- assert . deepStrictEqual ( parseConfig ( { } ) , {
99- github_ref : "" ,
100- github_repository : "" ,
101- github_token : "" ,
102- input_body : undefined ,
103- input_body_path : undefined ,
104- input_draft : undefined ,
105- input_prerelease : undefined ,
106- input_files : [ ] ,
107- input_name : undefined ,
108- input_tag_name : undefined ,
109- input_fail_on_unmatched_files : false ,
110- input_target_commitish : undefined ,
111- input_discussion_category_name : undefined
112- } ) ;
98+ assert . deepStrictEqual (
99+ parseConfig ( {
100+ // note: inputs declared in actions.yml, even when declared not required,
101+ // are still provided by the actions runtime env as empty strings instead of
102+ // the normal absent env value one would expect. this breaks things
103+ // as an empty string !== undefined in terms of what we pass to the api
104+ // so we cover that in a test case here to ensure undefined values are actually
105+ // resolved as undefined and not empty strings
106+ INPUT_TARGET_COMMITISH : "" ,
107+ INPUT_DISCUSSION_CATEGORY_NAME : ""
108+ } ) ,
109+ {
110+ github_ref : "" ,
111+ github_repository : "" ,
112+ github_token : "" ,
113+ input_body : undefined ,
114+ input_body_path : undefined ,
115+ input_draft : undefined ,
116+ input_prerelease : undefined ,
117+ input_files : [ ] ,
118+ input_name : undefined ,
119+ input_tag_name : undefined ,
120+ input_fail_on_unmatched_files : false ,
121+ input_target_commitish : undefined ,
122+ input_discussion_category_name : undefined
123+ }
124+ ) ;
113125 } ) ;
114126
115127 it ( "parses basic config with commitish" , ( ) => {
0 commit comments