Dynamic GitHub Actions Dropdowns — A Clever Workaround Made Reusable!

●4
calendar_today • schedule1 min read
— Originally published at dev.to

GitHub Actions doesn't natively support dynamically populated dropdown options for workflow_dispatch inputs. This can become a maintenance headache, especially when managing multiple packages in an npm monorepo.

I came across a clever workaround shared by @jeevan-vj, demonstrating how to dynamically maintain dropdown options by automatically updating GitHub Actions workflow YAML files.

Inspired by that approach, I built a reusable GitHub Actions workflow that uses a dedicated WORKFLOW_TOKEN to update workflow files and automatically discover publishable packages in an npm monorepo.

Here's what my implementation adds:

✅ Automatic package discovery — Detects publishable npm workspace packages without maintaining a hardcoded list.

✅ Multi-workflow synchronization — Keeps package dropdown options consistent across multiple GitHub Actions workflows.

✅ YAML formatting preservation — Uses Python and ruamel.yaml to update workflow configurations while preserving their structure and formatting.

✅ Automatic and manual execution — Supports synchronization on push as well as manual triggering when needed.

✅ Configurable token authentication — Accepts a workflow-token secret, allowing each consuming repository to choose its own secret name.

✅ No unnecessary commits — Updates workflow files only when package options actually change.

The end result?

My release, publish, restore, reset, and release-draft workflows now automatically stay synchronized with the publishable packages in my npm monorepo.

No more manually updating package dropdowns every time a package is added, renamed, or removed.

Even better, the solution is reusable across repositories, so I have adopted the same automation in other repos without duplicating the synchronization logic.

Original inspiration — @jeevan-vj:
https://github.com/jeevan-vj/iamjeevan/blob/master/data/blog/dynamically-populating-parameter-options-in-manual-github-action.md

My reusable workflow implementation:
https://github.com/moyarich/reusable-workflows/blob/main/.github/workflows/reusable_sync-release-package-choices.yml

Real-world implementation — Workspace Tools:
https://github.com/moyarich/workspace-tools/blob/main/.github/workflows/sync-release-package-choices.yml

Huge credit to @jeevan-vj for sharing the original workaround. It's a great example of how an open-source idea can evolve into a reusable solution that benefits other developers.

How are you managing dynamic inputs in your GitHub Actions workflows? Have you found another approach?

1 Comment

0 votes
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Demystifying the Ghost Failure in Firebase Hosting GitHub Actions

Next Big Creative - Jul 2

Static vs Dynamic Websites for SEO

floxolab - Sep 8

The Validation Bottleneck: Why Testing Is the New Speed Limit

Tom Smithverified - Apr 13

Hello World to GitHub Actions: Your First Automated Workflow

Vishwajeet Kondi - Dec 25, 2025

Deploy your application on Vercel with GitHub Actions

OctoLab - Aug 20, 2025
chevron_left
131 Points • 4 Badges
1Posts
0Comments
I am an experienced software engineer, technology community builder, and open-source advocate

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
2 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!