Repository navigation
Conversation
@kobihikri ^^ 🦝 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2461 +/- ##
=======================================
Coverage 88% 88%
=======================================
Files 85 85
Lines 12143 12143
=======================================
Hits 10666 10666
Misses 1477 1477 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR hardens the reusable workflow_call GitHub Actions workflow by ensuring the branch name is passed to the README augmentation script as a properly quoted runtime argument, rather than being interpolated into the shell command text.
Changes:
- Move
${{ github.head_ref || github.ref_name }}into a step-level environment variable (BRANCH_REF). - Quote the branch argument in the
augment_links.pyinvocation to avoid shell word-splitting and prevent branch-name characters from being interpreted by the shell.
|
@kobihikri, could you pls check the failing CI checks? |
The three publish workflows call build-package.yml with no `with:` block, so `link-check` falls back to its `default: true`. On a pull request from a fork, augment_links.py rewrites the README to github.com/roboflow/supervision/<blob|tree>/$BRANCH/..., where $BRANCH is the fork's branch and does not exist upstream, so lychee gets two 404s and fails the build. ci-tests.yml already guards against this. This applies the same expression to the three remaining callers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| contents: read | ||
| uses: ./.github/workflows/build-package.yml | ||
| with: | ||
| # only run link check on PRs from the same repo |
There was a problem hiding this comment.
That would prevent checking any forked PRs, so we couldn't accept them...
|
Sorry for the slow reply. I had a look, and I think those failures were older than this PR — and they're green now. All three failing checks were the same job (
It wasn't the quoting change. I ran the script against a clone of Byte-identical, so the link check sees the same file either way. These three workflows only run here at all because their The guard already exists in this repo. In 0dc9188 you added the link-check: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
So I pushed one commit, One thing I'd rather you decided than me: it widens this PR past the single quoting change you originally looked at. If you'd sooner keep this one narrow, say the word and I'll move the guard into its own PR and reset this branch. (Disclosure: I use AI tooling to help me read code at this scale. The reproduction, the job log, and the commit are mine, and I've checked them.) |
Hi, and thanks for supervision.
In
.github/workflows/build-package.yml, the branch name is passed to the README script by interpolation, unquoted:Actions expands
${{ ... }}into the script text before bash runs, so the branch name becomes part of the command rather than an argument to the script. Git allows$,(,), backticks and spaces in branch names, and$(...)runs inside double quotes — and being unquoted here, a name containing a space would also split into two arguments, soaugment_links.pywould receive a truncated--branchvalue.Scope, honestly: this is a reusable
workflow_callworkflow, and where it is called frompull_requesta fork PR has a read-only token and no secrets. I am raising it as hardening and argument-robustness rather than as a live exploit.The change passes the value through
env:and quotes it:The
||fallback is preserved by keeping the whole expression in theenv:value, so the script receives the same branch string it does today, andcat README.mdis untouched.Disclosure: I used AI assistance to help spot this and prepare the change, and I read the workflow myself.