Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
eventPattern: {
detail: {
event: [
'pullRequestSourceBranchUpdated',
'pullRequestCreated',
],
},
},
},
);
rule.addTarget(new LambdaFunction(pullRequestFunction));
rule.addTarget(
new CodeBuildProject(pullRequestProject, {
event: RuleTargetInput.fromObject({
sourceVersion: EventField.fromPath('$.detail.sourceCommit'),
artifactsOverride: { type: 'NO_ARTIFACTS' },
environmentVariablesOverride: [
{
name: 'pullRequestId',
value: EventField.fromPath(
'$.detail.pullRequestId',
),
type: 'PLAINTEXT',
},
{
name: 'repositoryName',
value: EventField.fromPath(
'$.detail.repositoryNames[0]',
),
type: 'PLAINTEXT',
public bind(_rule: IRule): RuleTargetConfig {
const input = RuleTargetInput.fromObject({
sourceVersion: EventField.fromPath('$.detail.sourceCommit'),
artifactsOverride: { type: 'NO_ARTIFACTS' },
environmentVariablesOverride: [
{
name: 'pullRequestId',
value: EventField.fromPath('$.detail.pullRequestId'),
type: 'PLAINTEXT',
},
{
name: 'repositoryName',
value: EventField.fromPath('$.detail.repositoryNames[0]'),
type: 'PLAINTEXT',
},
{
name: 'sourceCommit',
value: EventField.fromPath('$.detail.sourceCommit'),