# GitHubSourceAction

Source that is provided by a GitHub repository.

Extends: Action › Action › GitHubSourceAction
Implements: IAction

- Source: [`aws-codepipeline-actions/lib/github/source-action.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codepipeline-actions/lib/github/source-action.ts#L100)

## Example

```ts
// Read the secret from Secrets Manager
const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.GitHubSourceAction({
  actionName: 'GitHub_Source',
  owner: 'awslabs',
  repo: 'aws-cdk',
  oauthToken: SecretValue.secretsManager('my-github-token'),
  output: sourceOutput,
  branch: 'develop', // default: 'master'
});
pipeline.addStage({
  stageName: 'Source',
  actions: [sourceAction],
});
```

## Initializer

```ts
new GitHubSourceAction(props: GitHubSourceActionProps)
```

## 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`: [GitHubSourceVariables](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.GitHubSourceVariables.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.
