Skip to content

Conversation

@lasith-kg
Copy link
Owner

Problem

Closes #161

When a workflow filename starts with a number (e.g., 1-release.yaml), the action incorrectly treats it as a workflow ID instead of a filename. This happens because JavaScript's parseFloat("1-release.yaml") returns 1, causing the action to skip the workflow ID lookup and attempt to dispatch workflow ID 1 directly.

Solution

Introduced a new getWorkflowIdFromValue() function that uses a strict regex (/^\d+$/) to only match strings consisting entirely of digits. This ensures filenames like 1-release.yaml are correctly treated as filenames, while pure numeric strings like 123456 are still recognized as workflow IDs.

Changes

  • Added getWorkflowIdFromValue() for strict integer-only parsing of workflow IDs
  • Simplified getNumberFromValue() by removing unnecessary try-catch
  • Added test case for workflow filenames starting with numbers

@lasith-kg lasith-kg merged commit 54899f6 into main Dec 28, 2025
1 check passed
@lasith-kg lasith-kg deleted the bugfix/issue-161 branch December 28, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fails to trigger workflow dispatch when workflow file name starts with a number.

2 participants