Github Action: trigger on a custom references, not branches or tags

I’m using a feature from Git internals - custom reference namespace. I call my namespace exp.

I create the custom references by: git update-ref refs/exp/myexp3 ef4cdada44e28b7c3ca32edd366320e075228d50

And push them:

$ git push origin exp/myexp3
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/dmpetrov/example-get-started-exp.git
 * [new branch]      refs/exp/myexp3 -> refs/exp/myexp3

It does not trigger my GitHub Action workflow. I used on: [push] and also tried:

on:
  push:
    branches:
      - '*'
    tags:
      - '*'
    exp:
      - '*'

None of these works.

In the documentation, I found references only to tags and branches: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags

Is there a way to make Actions trigger on custom references?

Replace single * with double **, so it could match refs with / in the name.

@dawidd6 thanks for the suggestion.
I’ve tried this but it didn’t help:

on:
  push:
    branches:
      - '*'
    tags:
      - '*'
    exp:
      - '**'

Tags work just fine even with a single star.

I’d appreciate it if you have any other ideas.

I didn’t know about this Git feature until now. Seems likely that this isn’t supported. You might want to make a feature request: https://support.github.com/contact/feedback

1 Like

Thank you for pointing me there! I’ve submitted a feature request. (Is there a way to find my request? :slight_smile: )

Support tickets can be found at https://support.github.com/tickets/
But not every inquiry ends up there. I honestly don’t follow what is tracked there and what isn’t. It might be limited to requests you send via a customer account.

@Simran-B I don’t see it in MyTickets :thinking:

I would be mindful of using niche features like Git namespaces with a service like GitHub. Although GitHub may incidentally support them, it’s unlikely that it will ever be a high priority and when a new product like Actions has so many high-impact feature requests, it’s unlikely anything that isn’t a high priority will be implemented. How important are Git namespaces to your workflow? You can see the public GitHub roadmap and filter by Actions to see how much work is already planned.

Sure, this is quite a specific feature. But these kinds of features open new scenarios that might create new types of distributed applications with Git under the hood.

I’m working on one of these applications - https://dvc.org - and the advance Git and GitHub features would help a lot in building a better user experience.

To be fair, the issue is not only in GitHub Action side. Git itself does not fully support it: refspecs being somewhat unfinished: mechanism without policy (from https://stackoverflow.com/questions/63866947/pushing-git-non-branch-references-to-a-remote#comment112982897_63868286)