Filtering on pull requests (console) - AWS CodePipeline

Filtering on pull requests (console)

You can use the console to add filters for pull requests with specified events and include or exclude branches or file paths.

Filtering on pull requests (console)
  1. Sign in to the AWS Management Console and open the CodePipeline console at http://console.aws.amazon.com/codesuite/codepipeline/home.

    The names and status of all pipelines associated with your AWS account are displayed.

  2. In Name, choose the name of the pipeline you want to edit. Otherwise, use these steps on the pipeline creation wizard.

  3. On the pipeline details page, choose Edit.

  4. On the Edit page, choose the source action you want to edit. Choose Edit triggers. Choose Specify filter.

  5. In Event type, choose Pull request from the following options.

    • Choose Push to start the pipeline when a change is pushed to your source repository. Choosing this enables the fields to specify filters for branches and file paths or Git tags.

    • Choose Pull request to start the pipeline when a pull request is opened, updated, or closed to the specified target branches. Choosing this enables the fields to specify filters for branches and file paths.

      You can optionally specify the following pull request events to filter:

      • Pull request is created

      • New revision is made to pull request

      • Pull request is closed

  6. In Filter type, choose one of the following options.

    • Choose Branch to specify the branches in your source repository that the trigger monitors in order to know when to start a workflow run. In Include, enter patterns for branch names in glob format that you want to specify for the trigger configuration to start your pipeline on changes in the specified branches. In Exclude, enter the regex patterns for branch names in glob format that you want to specify for the trigger configuration to ignore and to not start your pipeline on changes in the specified branches. See Working with glob patterns in syntax for more information.

      Note

      If the include and exclude both have the same pattern, then the default is to exclude the pattern.

      You can use regex patterns in glob format to define your branch names. For example, use main.* to match all branches beginning with main.*. See Working with glob patterns in syntax for more information.

      For a push trigger, specify the branches you're pushing to, that is, the destination branches. For a pull request trigger, specify destination branches you're opening pull request to.

    • (Optional) Under File paths, specify file path names for your trigger. Enter the names in Include and Exclude as appropriate.

      You can use regex patterns in glob format to define your file path names. For example, use prod.* to match all file paths beginning with prod.*. See Working with glob patterns in syntax for more information.