Avoid fallback download of artifacts when not on develop #18785
Avoid fallback download of artifacts when not on develop #18785maurelian merged 5 commits intoproposal/op-contracts/v6.0.0from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## proposal/op-contracts/v6.0.0 #18785 +/- ##
================================================================
- Coverage 71.34% 68.59% -2.76%
================================================================
Files 185 185
Lines 10914 10914
================================================================
- Hits 7787 7486 -301
- Misses 2983 3284 +301
Partials 144 144
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
f19d05e to
f2b1701
Compare
883e125 to
be71a3f
Compare
6f7f5d4 to
2cb8529
Compare
Removed unnecessary error handling and conditional logic to keep the script closer to the original CircleCI implementation for easier review.
2cb8529 to
b2e704b
Compare
| if [ "$USE_FALLBACK" = "true" ]; then | ||
| bash scripts/ops/pull-artifacts.sh --fallback-to-latest | ||
|
|
||
| j bash scripts/ops/pull-artifacts.sh --fallback-to-latest | ||
| else | ||
| bash scripts/ops/pull-artifacts.sh |
There was a problem hiding this comment.
Denial of Service (DoS): CI script fails artifact pull in use-latest-fallback.sh
use-latest-fallback.sh contains a stray j before the bash invocation, which will trigger command not found and (due to set -euo pipefail) abort the script, preventing artifact pulling and potentially failing the entire CI job.
Remove the stray j and ensure the fallback path executes bash scripts/ops/pull-artifacts.sh --fallback-to-latest as intended.
| if [ "$USE_FALLBACK" = "true" ]; then | |
| bash scripts/ops/pull-artifacts.sh --fallback-to-latest | |
| j bash scripts/ops/pull-artifacts.sh --fallback-to-latest | |
| else | |
| bash scripts/ops/pull-artifacts.sh | |
| if [ "$USE_FALLBACK" = "true" ]; then | |
| bash scripts/ops/pull-artifacts.sh --fallback-to-latest | |
| else | |
| bash scripts/ops/pull-artifacts.sh |
Don't like this finding? Reply "dismiss" and it won't appear again in future scans.
If it's acknowledged or addressed, reply "resolve" to mark it resolved.

This is a cherry pick onto the v6 proposal branch of #18788.
Summary
Avoids the fallback download of artifacts when not on
develop.This is achieved by refactoring the
get-target-branchlogic from CircleCI config into a reusable script that can be sourced by theuse-latest-fallbackscriptChanges
scripts/ops/get-target-branch.shcontaining the target branch detection logicscripts/ops/use-latest-fallback.shto source the new scriptscripts/checks/check-semver-diff.shto source the new script.circleci/config.ymlto use the new scriptBenefits