I am running a job when my pull request is labeled. But only for a certain label.
So, something like ths:
on:
pull_request:
branches:
- master
types:
- labeled
jobs:
my-job
if: github.event.label.name == 'approved'
I want to automerge only if this job succeeds. So, I made it a required job for this branch.
But I also submit other labels to my pull request. that says the status is “Skipped”. But for the purposes of automerge, a skipped job is just as good as success. And so if I submit a different label, automerge would activate.
I did try check this method:
jobs:
my-job
steps:
- name: Validate labels
uses: docker://agilepathway/pull-request-label-checker:latest
with:
all_of: approved,deploy
repo_token: ${{ secrets.GITHUB_TOKEN }}
But another wrinkle is that I am using this:
jobs:
my-job:
environment:
name: prod
So, this would block on all sorts of labels until it is approved.
In my opinion, a skipped job is not the same as a successful job.