Trigger workflow on registry_package event

I want to decouple my build workflows from my deployment workflows. I thought about using the registry_package event for that. Everytime a package is published or updated in the GitHub Package registry I want my workflow to trigger.

The problem is, how can I filter a specific package? There is currently no documentation available.

on:
  - registry_package:
    action:
      - 'updated'
    name: 'docker.pkg.github.com/<OWNER>/<REPO>/<PACKAGE>'

This is just a suggestion/example/thought of me. Maybe there could be support for multiple package names/tags?

1 Like

@riker09 is your action working here, or is it only your suggestion?

The docs says this (https://help.github.com/en/articles/workflow-syntax-for-github-actions#onevent_nametypes):

# Trigger the workflow on pull request activityon:release# Only use the types keyword to narrow down the activity types that will trigger your workflow. types:[published,created,edited]

So action would instead be types.

I tried with types but, even specifying [published, updated] does nothing. Removing types triggers the workflow on publish, and on update. So there’s a bug, or something not implemented here.

But, as you say, there is also a need for a filter.

My action is *not* working, this is a suggestion / something I’m currently evaluating.

I was under the impression that a release is something different from a published package in the GitHub Package Repository?

I believe that I have read somewhere in the documentation that not all actions have support for the types filter. Only specific actions do.

It is different, my bad, I was not clear enough.

I just wanted to say that your suggestion to use an action key would probably end up being implemented by GitHub with a types key instead, just like the release event.

I was hoping that my request would gain more attention. I don’t suppose you know anything more about this topic?

It feels that GitHub Actions is not particulary well-tailored for usage with a monorepo.

I have not tested it, but I don’t think that the registry_package event can be used to monitor a remote package registry?

1 Like

I am having similar issues.

Currently using docker to publish an image into github packages and would like this to trigger a deployment using ansible. However, the second trigger isn’t coming in.