File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ import text from './text';
8
8
const PR_NUMBER = parseInt ( process . env . PR_NUMBER || '0' , 10 ) ;
9
9
const FOLDERS_TO_CHECK = 'yarn.lock openapitools.json clients specs/bundled' ;
10
10
11
- async function isUpToDate ( ) : Promise < boolean > {
11
+ async function isUpToDate ( baseBranch : string ) : Promise < boolean > {
12
12
await run ( 'git fetch origin' ) ;
13
- return ( await run ( 'git status' ) ) . includes ( 'Your branch is up to date with' ) ;
13
+ return ( await run ( `git pull origin ${ baseBranch } ` ) ) . includes (
14
+ 'Already up to date.'
15
+ ) ;
14
16
}
15
17
16
18
/**
@@ -55,9 +57,9 @@ export async function pushGeneratedCode(): Promise<void> {
55
57
await run ( `git checkout -b ${ branchToPush } ` ) ;
56
58
}
57
59
58
- if ( ! ( await isUpToDate ( ) ) ) {
60
+ if ( ! ( await isUpToDate ( baseBranch ) ) ) {
59
61
console . log (
60
- `The branch ${ branchToPush } is not up to date with ${ baseBranch } , stopping this task and letting the new job push generated code.`
62
+ `The branch ' ${ baseBranch } ' is not up to date with origin , stopping this task and letting the new job push generated code.`
61
63
) ;
62
64
return ;
63
65
}
You can’t perform that action at this time.
0 commit comments