@@ -11,6 +11,7 @@ import { Octokit } from '@octokit/rest';
1111
1212const D360_TOKEN = core . getInput ( 'D360_TOKEN' ) ;
1313const D360_ARTICLE_ID = core . getInput ( 'D360_ARTICLE_ID' ) ;
14+ const D360_USER_ID = core . getInput ( 'D360_USER_ID' ) ;
1415const PUBLISH = core . getInput ( 'PUBLISH' ) === 'true' ;
1516const LTS_VERSIONS = ( core . getInput ( 'LTS_VERSIONS' ) || '7.10' ) . split ( ',' ) . map ( ( v ) => v . trim ( ) ) ;
1617
@@ -193,11 +194,15 @@ async function generateTable({ owner, repo } = {}) {
193194
194195 const forkResponse = await requestDocument360 ( 'put' , `Articles/${ D360_ARTICLE_ID } /fork` , {
195196 lang_code : "en" ,
196- user_id : "2511fd00-9558-4826-8d8c-4cc0c110f89c" ,
197+ user_id : D360_USER_ID ,
197198 version_number : response . data . data . version_number ,
198199 } ) ;
199200
200201 console . log ( forkResponse . data ) ;
202+
203+ if ( ! forkResponse . data . success ) {
204+ throw new Error ( `Failed to fork article: ${ JSON . stringify ( forkResponse . data . errors ) } ` ) ;
205+ }
201206 }
202207
203208 console . log ( 'Updating article' ) ;
@@ -211,7 +216,7 @@ async function generateTable({ owner, repo } = {}) {
211216 console . log ( 'publishing article' , updateResponse . data . data . version_number ) ;
212217
213218 const forkResponse = await requestDocument360 ( 'post' , `Articles/${ D360_ARTICLE_ID } /en/publish` , {
214- user_id : "2511fd00-9558-4826-8d8c-4cc0c110f89c" ,
219+ user_id : D360_USER_ID ,
215220 version_number : updateResponse . data . data . version_number ,
216221 publish_message : 'Update support versions table via GitHub Action' ,
217222 } ) ;
0 commit comments