# CodeStarConnectionsSourceAction

A CodePipeline source action for the CodeStar Connections source, which allows connecting to GitHub and BitBucket.

Extends: Action › Action › CodeStarConnectionsSourceAction
Implements: IAction

- Source: [`aws-codepipeline-actions/lib/codestar-connections/source-action.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codepipeline-actions/lib/codestar-connections/source-action.ts#L94)
- Type last changed: v2.4.0 · 6 Jan 2022

## Example

```ts
declare const project: codebuild.Project;

const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.CodeStarConnectionsSourceAction({
  actionName: 'BitBucket_Source',
  owner: 'aws',
  repo: 'aws-cdk',
  output: sourceOutput,
  connectionArn: 'arn:aws:codestar-connections:us-east-1:123456789012:connection/12345678-abcd-12ab-34cdef5678gh',
  variablesNamespace: 'SomeSpace', // optional - by default, a name will be generated for you
});

// later:

new codepipeline_actions.CodeBuildAction({
  actionName: 'CodeBuild',
  project,
  input: sourceOutput,
  environmentVariables: {
    COMMIT_ID: {
      value: sourceAction.variables.commitId,
    },
  },
});
```

## Initializer

```ts
new CodeStarConnectionsSourceAction(props: CodeStarConnectionsSourceActionProps)
```

## Properties

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

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

- `variables`: [CodeStarSourceVariables](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.CodeStarSourceVariables.html) — 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.
