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
Open
Skip Rust build in pr-check when no tool YAML files are changed#1805sbryngelson wants to merge 1 commit intoanalysis-tools-dev:masterfrom
sbryngelson wants to merge 1 commit intoanalysis-tools-dev:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a PR only touches
ci/**files (nodata/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 thepr-commentworkflow to fail with:Because
upload-artifact@v4won't create an artifact when there are no output files, leavingpr-commentwith nothing to download.Fix
has_filesoutput from the "Get changed tool files" stephas_files == 'false', writespr_number.txtandresult.txtdirectly — no Rust build neededif: steps.changed.outputs.has_files == 'true'The artifact is now always uploaded with at least
pr_number.txtandresult.txt, so thepr-commentdownload never fails. CI-only PRs also skip the full Rust compilation, making them faster.Follow-up to #1803.