ci: compare Cargo.lock to common ancestor instead of main
What changed, and why it matters
This is a one-line change to Trezor's GitHub Actions CI workflow. It adjusts how the build system checks whether the Rust dependency lockfile (Cargo.lock) has changed. Previously it compared against the main branch; now it compares against the pull request's base branch (the branch the PR targets). This is a normal CI correctness fix and has no direct security relevance.
No security action required. This is a routine CI workflow improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The prebuild.yml workflow step ‘Ask git’ now uses git diff --exit-code origin/${{ github.base_ref }}...HEAD instead of hardcoded origin/main when deciding if core/embed/rust/Cargo.lock was modified. This makes the check work correctly for pull requests targeting branches other than main. The change is purely a CI configuration improvement.
Changed components
.github/workflows/prebuild.ymlInspect captured patch +1 / −1
diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml
index a48093a9..96398dac 100644
--- a/.github/workflows/prebuild.yml
+++ b/.github/workflows/prebuild.yml
@@ -108,7 +108,7 @@ jobs:
- name: Ask git
run: |
- git diff --exit-code origin/main -- core/embed/rust/Cargo.lock || echo cargo_modified=1 > $GITHUB_ENV
+ git diff --exit-code origin/${{ github.base_ref }}...HEAD -- core/embed/rust/Cargo.lock || echo cargo_modified=1 > $GITHUB_ENV
cat $GITHUB_OUTPUT
- name: Find Comment
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.