How to trigger GitHub Actions workflow only for specific label events (not all labels) #159187
Replies: 3 comments
-
| I think GitHub Actions does not currently support filtering workflow triggers by specific label names at the "on" level 
 | 
Beta Was this translation helpful? Give feedback.
-
| @aelmizeb | 
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.
-
Select Topic Area
Question
Body
I have a CI orchestration workflow that I want to trigger only when:
A PR is opened, synchronized, or reopened
A specific label (let's call it "special-label-ci") is added or removed from a PR
Currently, my workflow uses:
The problem is this causes the workflow to run whenever any label is added to the PR, not just my "special-label-ci" label. While I can add conditional logic in the jobs to skip processing for other labels, the workflow still shows up in the Actions tab and triggers unnecessarily.
Is there a way to make GitHub Actions only trigger a workflow when a specific label is involved, not for all labels? I want to avoid the workflow from being triggered at all for non-special label events.
I've tried various approaches with job-level conditions, but they still show as workflow runs (even if skipped). I've also considered using separate workflows with repository_dispatch, but that seems overly complex for what should be a simple filtering need.
Any suggestions for a cleaner approach? I'm trying to avoid noise in the Actions tab and unnecessary workflow runs for unrelated label changes.
Beta Was this translation helpful? Give feedback.
All reactions