@@ -16,7 +16,7 @@ gh.authenticate({ type: 'oauth', token: githubToken })
1616const determineFilesChanged = createFilesChangedDeterminer ( gh )
1717const getParsedYaml = createParsedYamlRetriever ( gh )
1818
19- const nullYaml = ' kind: pipeline\nname: default \ntrigger:\n event:\n exclude: [ "*" ]'
19+ const nullYaml = index => ` kind: pipeline\nname: default_ ${ index } \ntrigger:\n event:\n exclude: [ "*" ]`
2020
2121const app = express ( )
2222app . post ( '/' , bodyParser . json ( ) , async ( req , res ) => {
@@ -45,7 +45,7 @@ app.post('/', bodyParser.json(), async (req, res) => {
4545 return res . sendStatus ( 500 )
4646 }
4747
48- const finalYamlDocs = parsedYaml . map ( py => {
48+ const finalYamlDocs = parsedYaml . map ( ( py , index ) => {
4949 if ( py . kind !== 'pipeline' ) return yaml . stringify ( py )
5050 if ( py . trigger && py . trigger . changeset && py . trigger . changeset . includes ) {
5151 const requiredFiles = py . trigger . changeset . includes
@@ -65,7 +65,7 @@ app.post('/', bodyParser.json(), async (req, res) => {
6565 return matchedFiles . length
6666 } )
6767
68- return trimmedSteps . length ? yaml . stringify ( { ...py , steps : trimmedSteps } ) : nullYaml
68+ return trimmedSteps . length ? yaml . stringify ( { ...py , steps : trimmedSteps } ) : nullYaml ( index )
6969 } )
7070
7171 res . json ( { Data : finalYamlDocs . join ( '\n---\n' ) } )
0 commit comments