File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,22 @@ import processFiles from "../process.js";
4
4
export default async function ( octokit : Octokit , config : Config , files : File [ ] ) : Promise < Rule [ ] > {
5
5
// Get results
6
6
let res : Rule [ ] [ ] = await Promise . all ( files . map ( async file => {
7
+ let filename = '' ;
7
8
if ( file . filename . startsWith ( "assets/eip-" ) && ! files . some ( f => f . filename == `EIPS/${ file . filename . split ( "/" ) [ 2 ] } .md` ) ) {
8
- return processFiles ( octokit , config , [ {
9
- filename : `EIPS/${ file . filename . split ( "/" ) [ 1 ] } .md` ,
10
- status : 'modified' ,
11
- } ] ) ;
9
+ filename = `EIPS/${ file . filename . split ( "/" ) [ 1 ] } .md` ;
12
10
} else if ( file . filename . startsWith ( "assets/erc-" ) && ! files . some ( f => f . filename == `ERCS/${ file . filename . split ( "/" ) [ 2 ] } .md` ) ) {
13
- return processFiles ( octokit , config , [ {
14
- filename : `ERCS/${ file . filename . split ( "/" ) [ 1 ] } .md` ,
15
- status : 'modified' ,
16
- } ] ) ;
11
+ filename = `ERCS/${ file . filename . split ( "/" ) [ 1 ] } .md` ;
17
12
}
18
- return [ ] ;
13
+ if ( filename == '' ) {
14
+ return [ ] ; // Not an asset file
15
+ }
16
+ if ( files . some ( file => file . filename == filename ) ) {
17
+ return [ ] ; // Already covered by the relevant rules, so avoid potential conflicts by short circuiting
18
+ }
19
+ return processFiles ( octokit , config , [ {
20
+ filename,
21
+ status : 'modified' ,
22
+ } ] ) ;
19
23
} ) ) ;
20
24
21
25
// Merge results
You can’t perform that action at this time.
0 commit comments