Skip to content

Variable resolution fails for runs-on when using workflow_dispatch events #35123

@pva2007

Description

@pva2007

Description

When using repository variables in the runs-on field, workflows triggered by push or PR events work correctly, but workflows triggered manually via workflow_dispatch hang indefinitely. The workflow appears to be waiting for a runner but never gets assigned one.

Steps to Reproduce
Set up a Gitea repository with a repository variable (e.g., RUNNER with value matching a runner label)
Create a workflow that uses this variable in the runs-on field
Trigger the workflow via workflow_dispatch

Expected Behavior
The workflow should start running on the specified runner, just as it does when triggered by push/PR events.

Actual Behavior
The workflow stays in a pending state indefinitely. No runner is assigned to the job.

name: Test on: workflow_dispatch jobs: test: runs-on: ${{ vars.RUNNER }} steps: [...]

Workaround
Using a hardcoded runner label instead of a variable works correctly

Additional Notes
This issue only affects workflow_dispatch events. The same workflow with the same variable works correctly when triggered by push or PR events.

Gitea Version

1.24.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

ubuntu

How are you running Gitea?

My gitea runs in a container.

Database

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions