Skip to content

Skip Rust build in pr-check when no tool YAML files are changed#1805

Open
sbryngelson wants to merge 1 commit intoanalysis-tools-dev:masterfrom
sbryngelson:fix-pr-check-no-tool-files
Open

Skip Rust build in pr-check when no tool YAML files are changed#1805
sbryngelson wants to merge 1 commit intoanalysis-tools-dev:masterfrom
sbryngelson:fix-pr-check-no-tool-files

Conversation

@sbryngelson
Copy link
Copy Markdown
Contributor

Problem

When a PR only touches ci/** files (no data/tools/ YAMLs), the PR Check workflow still triggers. The existing code ran the full Rust build and binary anyway, but with no tool files to check. This caused the pr-comment workflow to fail with:

Unable to download artifact(s): Artifact not found for name: pr-check-output

Because upload-artifact@v4 won't create an artifact when there are no output files, leaving pr-comment with nothing to download.

Fix

  • Emit a has_files output from the "Get changed tool files" step
  • Add a "Skip: no tool files to check" step that runs when has_files == 'false', writes pr_number.txt and result.txt directly — no Rust build needed
  • Guard all Rust steps (toolchain, cache, build, run) with if: steps.changed.outputs.has_files == 'true'

The artifact is now always uploaded with at least pr_number.txt and result.txt, so the pr-comment download never fails. CI-only PRs also skip the full Rust compilation, making them faster.

Follow-up to #1803.

When a PR only touches ci/** files (not data/tools/), the PR Check
workflow still triggers but has no tool files to check. Previously this
caused the pr-comment workflow to fail with "Artifact not found" because
the artifact upload could produce an empty/missing artifact.

Fix: emit a has_files output from the changed-files step and short-circuit
immediately when it is false — writing pr_number.txt and result.txt
directly so the artifact always exists. All Rust build steps are skipped
when there is nothing to check.
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.

1 participant