dependabot / fetch-metadata

Extract information about the dependencies being updated by a Dependabot-generated PR.
MIT License
164 stars 63 forks source link

Allow for additional event types / Ignore "pull-request"+"pull-request-target" event types? #397

Open vegaasen opened 1 year ago

vegaasen commented 1 year ago

Hello 👋 !

First of all, thanks for a great Github Actions plugin!

Second, I'd like to create a feature-request in regards to which events being listened too (or rather, skipped verified).

The 'problem' we're currently facing is that we're using Azure Pipeline to build/test/deploy/whatever, and also Github Actions to enable auto-merge of dependencies.

Right now, as our CI-platform is not on Github, we can't use any of the "run after" options, as there is no action defined to use as a trigger-point - since this is all handled on Azure DevOps.

However, in Github Actions, we can come by this issue by just defining the following on: clause, accompanied by a verification on which type of "suite" were executed, and what the "conclusion" for that check suite was:

on:
  check_suite:
    types:
      - completed
# ...
# ...(more stuff)...
# ...
jobs:
  dependabot-merge:
    name: 🤖 merge it
    runs-on: ubuntu-latest
    if: |
      github.event.check_suite.app.name == 'Azure Pipelines' && 
      github.event.check_suite.conclusion == 'success'
# ...
# ...(more stuff)...
# ...

This works as expected in other cases where we have an Github Action defined, however, not with the fetch-metadata-Action. The reason for it not working being located close to here: https://github.com/dependabot/fetch-metadata/blob/main/src/dependabot/verified_commits.ts#L18:

  if (!pr) {
    core.warning(
      "Event payload missing `pull_request` key. Make sure you're " +
        'triggering this action on the `pull_request` or `pull_request_target` events.'
    )
    return false
  }

We've added skipVerification: true, but, this won't have an effect as the event is being verified regardless. Would it be possible to add a new property for this (like: skipEventVerification: true or make this part of the skipVerification: true property? That would be great and it would solve our issue regarding this - or, if you have some other suggestion on how to achieve this, that would suffice too 🌮 😄 .

Thanks and hugs from, vegard

fatmcgav commented 11 months ago

Another :+1: here... Our use-case is subtly different in that we're attempting to use the status event to trigger a merge following a CI run.

Being able to pass in a PR number that can be used to resolve the details of the PR would be great...