Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private addSourceStage() {
const placement = { atIndex: 0 }
const stage = this.pipeline.addStage('SourceStage', { placement })
const branch = this.branchName
const oauthToken = this.getToken()
const owner = this.getOwner()
const repo = this.getRepo()
const sourceConfig = { branch, oauthToken, owner, repo, stage }
// tslint:disable-next-line:no-unused-expression
this.source = new GitHubSourceAction(this, 'GitHubSource', sourceConfig)
}
addSourceStage(name: string, config: SourceStageConfig) {
const stageName = name
const sourceName = `${this.id}-github-${name}`
const { atIndex, branch, owner, pipeline, poll, repo, oauthToken } = config
const stage = pipeline.addStage(stageName, { placement: { atIndex } })
const stageConfig = {
branch,
oauthToken,
outputArtifactName: name,
owner,
pollForSourceChanges: poll,
repo,
stage,
}
return new GitHubSourceAction(this, sourceName, stageConfig)
}