Search code examples
aws-cdkaws-codepipeline

How to disable GitHubSourceAction from triggering pipeline on push?


I have the following first stage in a pipeline that builds my app and deploys it to an S3 bucket behind a CloudFront distrubution:

    pipeline.addStage({
      stageName: 'Source',
      actions: [
        new GitHubSourceAction({
          actionName: 'Checkout',
          owner: "au-research", 
          repo: "raido-v2",
          branch: "main",
          oauthToken: SecretValue.secretsManager(
            'ardc-shorn-github-personal-token' ),
          output: outputSources,
          trigger: GitHubTrigger.NONE,
        }),
      ],
    })

My understanding was that setting the trigger to None meant that the pipeline would only run if I trigger it manually. But it seems to trigger whenever I push to Github.

When I edit the stage action manually, I only see the options for github or CodePipeline: enter image description here

What CDK config can I use to make the pipeline only run when I do a manual "release change" action (via console or command line)?


Solution

  • I've had this happen due to leftover GitHub webhooks - even though the trigger is set to NONE, there may still be a webhook on the github side that is still triggering the build.

    Go to https://github.com/your-github-org/your-github-repo/settings/hooks and delete any webhooks you might have there.