Skip to content

Execute a step only if pull_request is merged #26817

Execute a step only if pull_request is merged #26817
Oct 1, 2021 · 1 answer

Workflow with following trigger points:

on: 
  push:
  pull_request:
    branches:
      - main
      - release/**

I need to perform some action only when a pull_request is merged.
I am not able to capture pull_request closed event. On merge, there is only a single workflow triggered for push on main branch.

Seems like I am missing some configuration but not sure exactly.

I was able to resolve it by adding ‘closed’ to the types list

on: 
  push:
  pull_request:
    branches:
      - main
      - release/**
    types: [opened, synchronize, reopened, closed]

Replies

1 suggested answer

I was able to resolve it by adding ‘closed’ to the types list

on: 
  push:
  pull_request:
    branches:
      - main
      - release/**
    types: [opened, synchronize, reopened, closed]
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant