SLN
SLN

Reputation: 5082

Trigger a pipeline dependes on Open a PR and the later push to the open PR

What is needed?

The pipeline is deploy the resources to the development environment for testing. The pipeline shall be triggered when a PR is opened that a feature branch want to merge to the development branch. Trigger the pipeline by open the PR is easy. However, things are not always going well for the first try. things may need to be changed after code review and a new commit is needed.

Issue:

But how to trigger the pipeline when the new commit is pushed to the un-merged feature branch? would the edited type below do the trick?

on:
  pull_request:
    types: [opened, reopened, edited]

Upvotes: 1

Views: 55

Answers (1)

Matteo
Matteo

Reputation: 39380

You should add the synchronize type, as example:

on:
  pull_request:
    types: [opened, reopened, edited, synchronize]

See also https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request

Upvotes: 1

Related Questions