0
votes

I am new to Github actions and I have searched all over to answer my question. I have an action setup to run on all push events but apparently that does not count for merging pull requests. So I wanted to know how I can run an action when a pull request is merged.

1

1 Answers

0
votes
name: CI
on: push

jobs:
  test:
    name: test
    ... 

  deploy:
    name: Deploy
    needs: [test] # will wait until test finished
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/master'
    steps:
      ...

One way is to use if condition.