@@ -5,11 +5,8 @@ import { updateDepots } from './update'
55
66const repoInputRegex = / [ ^ \/ \n \s \t ] + \/ [ ^ \/ \n \s \t ] + /
77
8- function getRepositoryIdentifier ( ) : RepositoryIdentifier {
8+ function getRepositoryIdentifier ( repoInput : string ) : RepositoryIdentifier {
99 const repo : { owner : string ; repo : string } = github . context . repo
10- const repoInput = core . getInput ( 'repo' )
11-
12- core . info ( 'Repository input: ' + repoInput )
1310
1411 if ( repoInput . match ( repoInputRegex ) ) {
1512 const parsedRepoInput = repoInput . split ( '/' )
@@ -18,6 +15,18 @@ function getRepositoryIdentifier(): RepositoryIdentifier {
1815 } else throw new Error ( 'Invalid repository input: ' + repoInput )
1916 return repo
2017}
18+ function getRepositoryIdentifiers ( ) : Record <
19+ 'srcRepo' | 'destRepo' ,
20+ RepositoryIdentifier
21+ > {
22+ const destInput = core . getInput ( 'repo' )
23+ let srcInput = core . getInput ( 'source-repo' )
24+ srcInput ??= destInput
25+
26+ const srcRepo = getRepositoryIdentifier ( srcInput )
27+ const destRepo = getRepositoryIdentifier ( destInput )
28+ return { srcRepo, destRepo }
29+ }
2130
2231function getDepotLocations ( ) : DepotRouteMap {
2332 const stableBranch = core . getInput ( 'branch' )
@@ -43,16 +52,15 @@ function getDepotLocations(): DepotRouteMap {
4352 */
4453export async function run ( ) : Promise < void > {
4554 try {
46- const repo = getRepositoryIdentifier ( )
55+ const repos = getRepositoryIdentifiers ( )
4756 const routes = getDepotLocations ( )
4857
4958 const readableFlag = core . getInput ( 'readable' ) === 'true'
5059 const ghToken = core . getInput ( 'token' )
5160 const message = core . getInput ( 'message' )
5261
5362 updateDepots ( {
54- destRepo : repo ,
55- srcRepo : repo ,
63+ ...repos ,
5664 routes,
5765 readableJson : readableFlag ,
5866 token : ghToken ,
0 commit comments