Replies: 3 comments 3 replies
-
|
Hi @minesunny By default, GitHub’s Actions tab only lists workflows from the default branch, so if you create a workflow in another branch, it won’t appear there unless you switch branches. To trigger a workflow_dispatch on a non-default branch, you have two main options: 1. Trigger from the Actions UI
2. Trigger via GitHub API
{
"ref": "branch-name",
"inputs": { ... }
}
|
Beta Was this translation helpful? Give feedback.
-
|
You can trigger workflow_dispatch from a non-default branch, but a few details matter. 1) Check the basics
name: build
on:
workflow_dispatch:
inputs:
env:
description: Environment
required: false
default: dev
2) Trigger from the UIThe branch selector is not on the “All workflows” list. You’ll see it only on the page for a specific workflow:
If you still don’t see the branch: the workflow file probably isn’t present on that branch, or the YAML has a syntax error so GitHub didn’t register it. 3) Trigger with CLI (easy)# Install GitHub CLI and auth first: gh auth login
gh workflow run .github/workflows/<name>.yml \
--ref feature/my-branch \
-f env=dev4) Trigger with REST APIcurl -X POST \
-H "Authorization: Bearer <TOKEN_WITH_WORKFLOW_SCOPE>" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/<owner>/<repo>/actions/workflows/<name>.yml/dispatches \
-d '{"ref":"feature/my-branch","inputs":{"env":"dev"}}'5) Common gotchas
If you want, share your repo/branch name and the workflow file path, and I’ll point out exactly what’s missing. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Question
What GitHub Actions topic or product is this about?
Actions Runner
Discussion Details
the default workflows show that the defualt branch have, if I create a new workflow on the new branch, it doesn't show that and I cloudn't tragger that
Beta Was this translation helpful? Give feedback.
All reactions