Skip to content

Fix wait-on-check-action ref mismatch#14

Merged
PhantomDave merged 3 commits into
mainfrom
copilot/fix-wait-on-check-action
Nov 14, 2025
Merged

Fix wait-on-check-action ref mismatch#14
PhantomDave merged 3 commits into
mainfrom
copilot/fix-wait-on-check-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 14, 2025

The deploy workflow fails with "The requested check was never run against this ref" because wait-on-check-action uses branch refs instead of commit SHAs.

Changes

  • Backend wait step: Use github.sha instead of github.ref
  • Frontend wait step: Use github.sha instead of github.ref
# Before
ref: ${{ github.ref }}

# After
ref: ${{ github.sha }}

Check runs are tied to commit SHAs, not branch refs. Both wait steps now correctly reference the commit SHA to find the corresponding check runs from build-backend-image.yml and build-frontend-image.yml workflows.

Original prompt

GitHub Copilot Chat Assistant

Problem (from job logs)

  • The wait-on-check action aborted with: "The requested check was never run against this ref, exiting...".
  • The action is called with ref: ${{ github.ref }} and check-name values that do not match the check-run names seen in the logs (logs show checks like "Build and Lint Frontend", "Generate GraphQL Schema", etc.). The action therefore cannot find a matching check run for the ref/name pair.

Root causes

  1. ref mismatch: ${{ github.ref }} expands to a branch ref (e.g. refs/heads/main) but check runs are tied to the commit SHA. The wait action expects the exact ref/sha used by the check runs.
  2. check-name mismatch: the names supplied to wait-on-check-action must exactly match the check runs' names. The logs show a different name for the frontend check ("Build and Lint Frontend").

Fix (apply both changes)

  • Use the commit SHA for the ref argument: ref: ${{ github.sha }}.
  • Make check-name match the real check run names (from your logs change 'Build and Push Frontend Container' → 'Build and Lint Frontend' or whatever the build workflow actually reports).

Patch to .github/workflows/deploy-tailscale.yml (edit the wait steps)
Update the two wait steps as follows (apply to the copy at: https://github.com/PhantomDave/BankTrackerGraphQL/blob/5864cb3322890bf379414596c5e0b5bec2cec5b2/.github/workflows/deploy-tailscale.yml):

wait-for-backend (example)

  • change:
    ref: ${{ github.ref }}
    check-name: 'Build and Push Backend Container'
  • to:
    ref: ${{ github.sha }}
    check-name: 'Build and Push Backend Container' # only change ref if backend check name is already correct

wait-for-frontend

  • change:
    ref: ${{ github.ref }}
    check-name: 'Build and Push Frontend Container'
  • to:
    ref: ${{ github.sha }}
    check-name: 'Build and Lint Frontend' # must match exact check run name from the build workflow

Exact YAML snippets to replace (lines around 49–55 and 65–71):

  • Backend wait step
    before:

    • name: Wait for backend image build
      uses: lewagon/wait-on-check-action@v1.3.4
      with:
      ref: ${{ github.ref }}
      check-name: 'Build and Push Backend Container'
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      wait-interval: 10
      after:
    • name: Wait for backend image build
      uses: lewagon/wait-on-check-action@v1.3.4
      with:
      ref: ${{ github.sha }}
      check-name: 'Build and Push Backend Container'
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      wait-interval: 10
  • Frontend wait step
    before:

    • name: Wait for frontend image build
      uses: lewagon/wait-on-check-action@v1.3.4
      with:
      ref: ${{ github.ref }}
      check-name: 'Build and Push Frontend Container'
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      wait-interval: 10
      after:
    • name: Wait for frontend image build
      uses: lewagon/wait-on-check-action@v1.3.4
      with:
      ref: ${{ github.sha }}
      check-name: 'Build and Lint Frontend'
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      wait-interval: 10

Additional recommendations

  • Confirm the exact check-run names in the build workflows (open the Actions run for the build workflows and copy the exact check title). Update check-name values to match precisely (including whitespace, punctuation, and capitalization).
  • If multiple check runs must be waited on, supply them as separate entries (the action supports listing multiple check names; confirm syntax in action docs). Alternatively create a single canonical combined check name in the build workflow.
  • Confirm the build workflows run on the same commit/sha you’re deploying from (they must be triggered on the same push so their checks are tied to that commit).
  • After making the changes, re-run the Deploy via Tailscale workflow and verify the wait steps find the checks and proceed.

Reference

If you want, I can prepare the exact patch/PR with these edits (YAML changes above) so you can review and merge.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
@PhantomDave PhantomDave marked this pull request as ready for review November 14, 2025 16:04
Copilot AI review requested due to automatic review settings November 14, 2025 16:04
Copilot AI changed the title [WIP] Fix wait-on-check action to match check runs Fix wait-on-check-action ref and check-name mismatches Nov 14, 2025
Copilot AI requested a review from PhantomDave November 14, 2025 16:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR attempts to fix the wait-on-check-action configuration in the deploy workflow by changing from branch references to commit SHAs and updating check names. However, the frontend check name change introduces a critical bug that will cause deployment to wait for the wrong workflow.

Key Changes

  • Changed ref: ${{ github.ref }} to ref: ${{ github.sha }} for both backend and frontend wait steps ✅
  • Changed frontend check name from 'Build and Push Frontend Container' to 'Build and Lint Frontend' ❌ (incorrect)

Comment thread .github/workflows/deploy-tailscale.yml Outdated
ref: ${{ github.ref }}
check-name: 'Build and Push Frontend Container'
ref: ${{ github.sha }}
check-name: 'Build and Lint Frontend'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check name 'Build and Lint Frontend' is incorrect. This workflow should wait for the image build job from build-frontend-image.yml, not the CI/lint job from frontend.yml.

The correct check name should remain 'Build and Push Frontend Container' which matches the job name in build-frontend-image.yml (line 63). The 'Build and Lint Frontend' job is from a different workflow (frontend.yml) that runs CI checks but doesn't build the container image needed for deployment.

Suggested fix:

check-name: 'Build and Push Frontend Container'
Suggested change
check-name: 'Build and Lint Frontend'
check-name: 'Build and Push Frontend Container'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 797689b. Reverted the check-name to 'Build and Push Frontend Container' to correctly wait for the container image build workflow from build-frontend-image.yml.

@PhantomDave
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
Copilot AI changed the title Fix wait-on-check-action ref and check-name mismatches Fix wait-on-check-action ref mismatch Nov 14, 2025
@PhantomDave PhantomDave merged commit 5d0ac3d into main Nov 14, 2025
@PhantomDave PhantomDave deleted the copilot/fix-wait-on-check-action branch November 14, 2025 16:14
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.

3 participants