Skip to content

Fix workflow_dispatch bypass: force evaluation of skipped dependency conditions#324

Merged
greenc-FNAL merged 2 commits intomainfrom
copilot/verify-workflow-dispatch-behavior
Feb 13, 2026
Merged

Fix workflow_dispatch bypass: force evaluation of skipped dependency conditions#324
greenc-FNAL merged 2 commits intomainfrom
copilot/verify-workflow-dispatch-behavior

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Manual workflow triggers via workflow_dispatch were incorrectly skipping main jobs. GitHub Actions skips dependent jobs when needs dependencies are skipped—before evaluating the job's if condition. Jobs checking needs.detect-changes.result == 'skipped' were never evaluated.

Changes

Added always() to force condition evaluation when dependencies are skipped:

# Before
job:
  needs: [pre-check, detect-changes]
  if: >
    needs.detect-changes.result == 'skipped' ||
    (needs.detect-changes.result == 'success' && ...)

# After  
job:
  needs: [pre-check, detect-changes]
  if: >
    always() &&
    (needs.detect-changes.result == 'skipped' ||
     (needs.detect-changes.result == 'success' && ...))

Affected Workflows

  • coverage.yaml
  • python-check.yaml
  • cmake-build.yaml
  • clang-format-check.yaml
  • clang-tidy-check.yaml
  • cmake-format-check.yaml
  • actionlint-check.yaml
  • jsonnet-format-check.yaml
  • markdown-check.yaml

All workflows with detection bypass logic had the same pattern and required the same fix.


💡 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.

Add always() to job conditions that check for skipped detect-changes.
This forces GitHub Actions to evaluate the condition even when the
detect-changes job is skipped (e.g., during workflow_dispatch).

Without always(), GitHub Actions skips jobs before evaluating their
if conditions when a needed job is skipped.

Fixes workflow_dispatch invocation for:
- coverage workflow
- python-check workflow
- cmake-build workflow
- clang-format-check workflow
- clang-tidy-check workflow
- cmake-format-check workflow
- actionlint-check workflow
- jsonnet-format-check workflow
- markdown-check workflow

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Copilot AI changed the title [WIP] Verify workflow_dispatch invocation of coverage workflow Fix workflow_dispatch bypass: force evaluation of skipped dependency conditions Feb 13, 2026
Copilot AI requested a review from greenc-FNAL February 13, 2026 20:28
@greenc-FNAL
Copy link
Contributor

@phlexbot format

@github-actions
Copy link
Contributor

No automatic markdownlint fixes were necessary.

@github-actions
Copy link
Contributor

No automatic jsonnetfmt fixes were necessary.

@github-actions
Copy link
Contributor

No automatic cmake-format fixes were necessary.

@github-actions
Copy link
Contributor

No automatic clang-format fixes were necessary.

Copy link
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 fixes a critical workflow execution bug where manual triggers (workflow_dispatch) were incorrectly skipping main check jobs. GitHub Actions was skipping dependent jobs before evaluating their if conditions when a dependency was skipped. The fix adds always() to force condition evaluation in all affected workflows.

Changes:

  • Added always() && wrapper to 9 workflow files to force evaluation of job conditions when the detect-changes dependency is skipped
  • Restructured conditional logic with proper parenthesization to maintain the original intent while ensuring evaluation occurs
  • Ensures workflows run correctly on manual triggers, scheduled runs, and workflow calls

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/python-check.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/markdown-check.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/jsonnet-format-check.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/coverage.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/cmake-format-check.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/cmake-build.yaml Added always() to force evaluation when detect-changes is skipped (also handles generate-matrix dependency)
.github/workflows/clang-tidy-check.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/clang-format-check.yaml Added always() to force evaluation when detect-changes is skipped
.github/workflows/actionlint-check.yaml Added always() to force evaluation when detect-changes is skipped

@greenc-FNAL greenc-FNAL marked this pull request as ready for review February 13, 2026 20:51
@greenc-FNAL greenc-FNAL requested a review from knoepfel February 13, 2026 20:57
@greenc-FNAL greenc-FNAL merged commit d703e4c into main Feb 13, 2026
51 checks passed
@knoepfel knoepfel deleted the copilot/verify-workflow-dispatch-behavior branch February 24, 2026 20:58
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.

4 participants