Determine if adding labels prior to creating a PR

I have a workflow that triggers on pull_request. I trigger on labeled and unlabeled actions along with the other default ones. This is done so our “do not merge” labels can be applied and unapplied, having it properly gate the merge.

What I have discovered is that if choose to create a “New Pull Request” and add a label prior to pressing “Create Pull Request” a trigger will occur for labeled. I would ideally like to ignore any labels until after “Create Pull Request” has been pressed. It does not look there is a way to detect this. github.event.pull_request.status is open when labeled occurs before “Create Pull Request” has been pressed. After “Create Pull Request”, the trigger for opened still has a status of open.

Is there anyway to detect when labels are added or removed prior to Create Pull Request?

I found a solution that works. I essentially run a test that sets output to abort early. I have found that the pull request will have the labels already in existence. so I can check up against to see if they already exist within the pull request to ignore them.

  - name: Early Abort
    if: (github.event.action == 'labeled' && contains(github.event.pull_request.labels.*.name,
    run: echo "::set-output name=early-abort=true"

Argh, this was spoken too soon. It seems like there may not be a great way to do this. A pity as there are benefits to being able to better control things through adding or removing labels.