I want to trigger an action when the following constraints fulfilled.
pr merged to main branch AND pr contains label == 'site'.
This is what I came up with, the problem that this one is running when the pr is created.
Nothing happens when I merge it to main.
What am I doing wrong?
name: Build and push site
on:
pull_request:
branches: [main]
types: [labeled, closed]
jobs:
build-push-site:
if: github.event.pull_request.merged == true && contains( github.event.pull_request.labels.*.name, 'site')
uses: avifatal/nx-tokenct/.github/workflows/build-push.yml@main
with:
...
(inspired by this Run Github Actions when pull requests have a specific label)
Thanks