Skip to content

'pending' status causes polling loop to exit prematurely #106

Description

@frasch1712

Description

When a dispatched workflow run enters the pending state (e.g. due to a concurrency group or unavailable runner), the polling loop exits immediately and reports a false warning instead of continuing to wait.

Root Cause

In src/main.ts, the while loop only checks for three statuses:

while (runStatus === 'in_progress' || runStatus === 'queued' || runStatus === 'waiting') {

pending is a valid GitHub Actions run status but is not included. When the API returns pending, the loop exits and falls into the else branch:

} else {
  core.warning(`⚠️ Workflow run completed with status: ${runStatus}`)
}

This produces the misleading message:

⚠️ Workflow run completed with status: pending
🎉 Workflow conclusion: null

Expected Behavior

The polling loop should continue waiting when the status is pending, just like it does for queued or waiting.

Suggested Fix

while (
  runStatus === 'in_progress' ||
  runStatus === 'queued'      ||
  runStatus === 'waiting'     ||
  runStatus === 'pending'
) {

Steps to Reproduce

  1. Use wait-for-completion: true
  2. Dispatch a workflow that uses a concurrency group or is otherwise queued before a runner is assigned
  3. Observe the warning and conclusion: null

Environment

  • Action version: v1.3.2 (31e2b3319)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions