@@ -8,7 +8,7 @@ const run = require('../run');
88
99const octokit = new Octokit ( {
1010 auth : `token ${ config . secret . github . token } ` ,
11- previews : [ 'hellcat-preview' ] , // enables nested teams API
11+ previews : [ 'hellcat-preview' , 'mercy-preview' ] , // enables nested teams API
1212} ) ;
1313
1414
@@ -35,6 +35,16 @@ module.exports = async function(langInfo) {
3535 let translatedPath = path . join ( config . repoRoot , `${ langInfo . code } .${ config . repoSuffix } ` ) ;
3636 let existsTranslated = await fs . exists ( translatedPath ) ;
3737
38+ const newRepoName = `${ langInfo . code } .${ config . repoSuffix } ` ;
39+
40+
41+ await octokit . repos . replaceTopics ( {
42+ owner : config . org ,
43+ repo : newRepoName ,
44+ names : [ "javascript" , "tutorial" , langInfo . name . toLowerCase ( ) ]
45+ } ) ;
46+
47+
3848 debug ( "Local translated repo exists: " + existsTranslated ) ;
3949
4050 if ( existsTranslated ) {
@@ -44,8 +54,6 @@ module.exports = async function(langInfo) {
4454
4555 debug ( "Checking if remote repo exists" ) ;
4656
47- const newRepoName = `${ langInfo . code } .${ config . repoSuffix } ` ;
48-
4957 const { data : { total_count} } = await octokit . search . repos ( {
5058 q : `org:${ config . org } "${ newRepoName } "` ,
5159 } ) ;
@@ -78,6 +86,15 @@ module.exports = async function(langInfo) {
7886
7987 debug ( "Translated remote repo created" ) ;
8088
89+
90+ debug ( "Adding topics" ) ;
91+
92+ await octokit . repos . replaceTopics ( {
93+ owner : config . org ,
94+ repo : newRepoName ,
95+ names : [ "javascript" , "tutorial" , langInfo . name ]
96+ } ) ;
97+
8198 debug ( "Cloning local translated repo" ) ;
8299
83100 await run ( `git clone --no-local ${ config . langMain } .${ config . repoSuffix } ${ langInfo . code } .${ config . repoSuffix } ` , {
0 commit comments