# InspectorSourceCodeScanAction

CodePipeline invoke action that uses AWS InspectorScan for source code.

Extends: Action › Action › InspectorScanActionBase › InspectorSourceCodeScanAction
Implements: IAction

- Source: [`aws-codepipeline-actions/lib/inspector/source-code-scan-action.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-codepipeline-actions/lib/inspector/source-code-scan-action.ts#L19)
- Type last changed: v2.188.0 · 4 Apr 2025

## Example

```ts
declare const pipeline: codepipeline.Pipeline;

const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.CodeStarConnectionsSourceAction({
  actionName: 'CodeStarConnectionsSourceAction',
  output: sourceOutput,
  connectionArn: 'your-connection-arn',
  owner: 'your-owner',
  repo: 'your-repo',
});

const scanOutput = new codepipeline.Artifact();
const scanAction = new codepipeline_actions.InspectorSourceCodeScanAction({
  actionName: 'InspectorSourceCodeScanAction',
  input: sourceOutput,
  output: scanOutput,
});

pipeline.addStage({
  stageName: 'Source',
  actions: [sourceAction],
});
pipeline.addStage({
  stageName: 'Scan',
  actions: [scanAction],
});
```

## Initializer

```ts
new InspectorSourceCodeScanAction(props: InspectorSourceCodeScanActionProps)
```

## Properties

- `actionProperties`: [ActionProperties](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.ActionProperties.html) (required) — The simple properties of the Action, like its Owner, name, etc.

  Note that this accessor will be called before the `bind` callback.

- `variables`: [InspectorScanVariables](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.InspectorScanVariables.html) (required) — The variables emitted by this action.

## Methods

- `bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig` — The callback invoked when this Action is added to a Pipeline.

- `onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Rule` — Creates an Event that will be triggered whenever the state of this Action changes.
