Closed davidsteelebrady closed 2 years ago
Hi! Can you make sure your yaml file looks something like this:
name: "PR Title Checker"
on:
pull_request:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@v1.3.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The types under on: pull_request:
is what you're missing. In your case of re-naming the title, I think edited
is the one you're missing.
Hi @thehanimo Thanks for the quick response. I realised that the code example I added wasn't complete. We are testing for PR but not types. Thanks for the hint. Will report back.
jobs:
check:
if: ${{ github.event_name == 'pull_request' }}
name: PR Title check
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@v1.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
It does make me wonder what the default associated types are that would mean it doesn't fire.
From the docs,
By default, a workflow only runs when a
pull_request
's activity type isopened
,synchronize
, orreopened
. To trigger workflows for more activity types, use thetypes
keyword.
@thehanimo Yeah I had Edit
in place, it turned out to be labelled/unlabeled
that resolves it, which makes sense as a label is applied when broken.
Thanks for your help, closing now.
Good action!
@davidsteelebrady I'm glad that helped! But I don't seem to understand why labelled/unlabelled
helped? Afaik, in your case, a poorly formatted PR Title was labelled by the action. This title was then "edited" by the user right? Are you sure edited
is not what you're looking for?
Also, triggering this on labelled/unlabelled
seems redundant. For e.g, a poorly formatted title would initially trigger the action which in turn, labels the PR. This "labelling of the PR" then triggers another redundant check? Is there something I'm missing?
Hi there,
Potentially not understanding usage properly here but to replicate.