Skip to content

Fix workflow stalling on self-hosted runners by converting string literals to arrays#71

Merged
Kumara-Krishnan merged 5 commits into
mainfrom
copilot/fix-msix-build-release-stall
Jan 30, 2026
Merged

Fix workflow stalling on self-hosted runners by converting string literals to arrays#71
Kumara-Krishnan merged 5 commits into
mainfrom
copilot/fix-msix-build-release-stall

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 29, 2026

Fix MSIX Build Release Workflow on Self-Hosted Runners

Issue Analysis ✓

The workflow was failing with two issues:

  1. Runner selection: runs-on expressions evaluated to string literals instead of arrays
  2. Checkout failure: PR events tried to checkout invalid merge refs like 71/merge

Root Cause ✓

  1. GitHub Actions treats '[self-hosted, windows]' as a literal string, not an array of labels
  2. For PRs, github.ref_name returns the merge ref (e.g., 71/merge), which doesn't exist as a branch

Solution Implemented ✓

  • Fixed all 6 jobs to use fromJSON() for proper array conversion
  • Fixed checkout refs to use github.head_ref for pull requests
  • Simplified deploy-to-cloudflare checkout (never runs on PRs)
  • Removed redundant PR check from package job
  • Validated YAML syntax
  • Passed CodeQL security scan (0 alerts)
  • Verified workflow runs on self-hosted runners

Technical Changes ✓

1. Fixed runs-on expressions (All 6 jobs)

# Before: returns string '[self-hosted, windows]'
runs-on: ${{ condition && '[self-hosted, windows]' || 'windows-latest' }}

# After: returns array ["self-hosted", "windows"]
runs-on: ${{ condition && fromJSON('["self-hosted", "windows"]') || 'windows-latest' }}

2. Fixed checkout refs for pull requests

# Before: tries to checkout '71/merge' on PRs (fails)
ref: ${{ inputs.target_branch || github.ref_name }}

# After: checks out PR head branch on PRs
ref: ${{ inputs.target_branch || (github.event_name == 'pull_request' && github.head_ref) || github.ref_name }}

Verification ✓

  • Workflow successfully queued for self-hosted runner "captain-america-windows"
  • Checkout step now uses correct branch reference for PRs
  • All YAML syntax valid
  • No security vulnerabilities detected

Expected Behavior

  • Pull Requests: Jobs run on self-hosted Windows runners and checkout PR head branch
  • Manual Dispatch with self-hosted: Jobs run on self-hosted runners with appropriate labels
  • Push to main/ci: Jobs run on GitHub-hosted runners
Original prompt

The .github/workflows/msix-build-release.yml when invoked using manual dispatch and self-hosted option in main branch gets stalled in bump version to be picked up by a runner for execution. But the self-hosted, windows runner is actually idle. Figure it out and make sure it runs. The pr check already is supposed to run on self-hosted, windows only. Iterate and solve until it succeeds.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix stall in msix build release workflow Fix workflow stalling on self-hosted runners by converting string literals to arrays Jan 29, 2026
Copilot AI requested a review from Kumara-Krishnan January 29, 2026 22:46
@Kumara-Krishnan Kumara-Krishnan marked this pull request as ready for review January 30, 2026 16:41
@Kumara-Krishnan
Copy link
Copy Markdown
Collaborator

@copilot checks failing

Copy link
Copy Markdown
Author

Copilot AI commented Jan 30, 2026

@copilot checks failing

Fixed in commit d3d3223. The workflow was failing because:

  1. Checkout error: PR events tried to checkout 71/merge (invalid merge ref). Fixed by using github.head_ref for pull requests.
  2. Runner selection worked: The fromJSON() fix successfully queued jobs on self-hosted runner "captain-america-windows".

The workflow now correctly runs on self-hosted runners and checks out the proper branch for PRs.

Copilot AI requested a review from Kumara-Krishnan January 30, 2026 16:50
@Kumara-Krishnan Kumara-Krishnan merged commit 9f33740 into main Jan 30, 2026
8 checks passed
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.

2 participants