Skip to content

documentation on on.workflow_dispatch is not correct/complete #34884

Description

@tomsit-ionos

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#repository_dispatch

This event will only trigger a workflow run if the workflow file is on the default branch.

Note that this text is defined on 1 place ({% data reusables.actions.workflow-dispatch %}) and used in several places.
It might be that it is correct in some use cases.

What part(s) of the article would you like to see updated?

it is possible to run WFs via workflow-dispatch event on branches other than the default (thru the API, maybe not UI)
there are some ramifications though

  • the WF must have run at least once, otherwise GH doesnt seem to know it's name
  • i do this via GH CLI by also adding an on.push while on a feature branch

see

Additional information

cli/cli#5268

Activity

  1. added
    contentThis issue or pull request belongs to the Docs Content team
    on Oct 10, 2024
  2. added
    triageDo not begin working on this issue until triaged by the team
    on Oct 10, 2024
  3. changed the title [-]documentation on `on.workflow_dispatch` is not correct[/-] [+]documentation on `on.workflow_dispatch` is not correct/complete[/+] on Oct 10, 2024
  4. added
    actionsThis issue or pull request should be reviewed by the docs actions team
    and removed
    triageDo not begin working on this issue until triaged by the team
    on Oct 10, 2024
  5. nguyenalex836 commented on Oct 10, 2024

    @nguyenalex836
    Contributor

    @tomsit-ionos Thank you very much for raising an issue! ✨ While we appreciate the method you've shared to run WFs via the workflow-dispatch event on branches other than the default, this method isn't officially supported.

    For that reason, we are unable to add this to our docs. We still thank you for your willingness to contribute 🙇

    If you're looking for issues to pick up, take a look at our help wanted section to find open issues you can work on 💛

  6. tomsit-ionos commented on Oct 14, 2024

    @tomsit-ionos
    Author

    hm, that is unfortunate.
    But how do u test a new/modified WF definition before it is merged to main ?

  7. nguyenalex836 commented on Oct 14, 2024

    @nguyenalex836
    Contributor

    how do u test a new/modified WF definition before it is merged to main

    This question would best be handled by our wonderful support team - please feel free to reach out to them 💛

  8. tomsit-ionos commented on Oct 18, 2024

    @tomsit-ionos
    Author

    hi,
    i think i u might want to reopen this issue, as the API clearly states to be able to pass in a tag/branch name.
    image

    see https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event

  9. nguyenalex836 commented on Oct 18, 2024

    @nguyenalex836
    Contributor

    @tomsit-ionos Thank you! We're reviewing this now, and will provide an update after 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions