Skip to content

breaking,changelog: preserve https:// URLs in free /review base_file#121

Merged
reuvenharrison merged 4 commits into
mainfrom
fix/free-review-url-preserve-https-base
May 23, 2026
Merged

breaking,changelog: preserve https:// URLs in free /review base_file#121
reuvenharrison merged 4 commits into
mainfrom
fix/free-review-url-preserve-https-base

Conversation

@reuvenharrison
Copy link
Copy Markdown
Contributor

@reuvenharrison reuvenharrison commented May 23, 2026

Summary

Three commits:

  1. Fix — the free breaking and changelog actions built the /review base_file parameter with sed 's/.*://'. That strips the git-ref prefix from origin/main:openapi.yaml, but for URL-shaped base/revision inputs (https://...) it also strips https: and emits a broken //host/.... The /review page then can't fetch the spec and renders the access-denied screen, misreporting the cause as a permissions problem. pr-comment already got this fix in pr-comment: preserve https:// URLs in free /review base_file #120; this applies the same strip_ref_prefix helper to breaking and changelog.

  2. Splittest.yaml had grown to 863 lines / 22 jobs across all four actions. Split into one workflow per action (test-diff, test-breaking, test-changelog, test-pr-comment). Pure move, jobs byte-identical.

  3. Tests — added the breaking/changelog equivalents of the existing pr_comment_free_review_url_* jobs, locking the duplicated helper against drift.

Behavior

base input base_file before base_file after
origin/main:openapi.yaml openapi.yaml openapi.yaml
openapi.yaml openapi.yaml openapi.yaml
https://example.com/openapi.yaml //example.com/openapi.yaml (broken) https://example.com/openapi.yaml

Test plan

  • sh -n passes on both entrypoints
  • Local smoke test: breaking entrypoint emits base_file=https%3A%2F%2Fraw... for a URL base and base_file=multi-file%2Fopenapi.yaml for a git-ref base
  • Regression jobs added for breaking and changelog (preserve-https + strip-git-ref), mirroring the pr-comment pair

Note

This makes the emitted URL well-formed. It does not change the separate, still-open decision about restricting the page-side spec fetch to GitHub hosts (the token-leak / SSRF item), which is tracked separately.

reuvenharrison and others added 4 commits May 23, 2026 11:39
The free breaking and changelog actions built the /review base_file
parameter with `sed 's/.*://'`, which strips the git-ref prefix from
inputs like "origin/main:openapi.yaml". For URL-shaped base/revision
inputs (https://...), the same sed also strips "https:" and leaves a
broken "//host/..." that the /review page cannot fetch, so the page
renders the access-denied screen and misreports the cause as a
permissions problem.

pr-comment already got this fix in #120. This applies the same
strip_ref_prefix helper (passes http(s):// through unchanged, strips
the ref prefix otherwise) to breaking and changelog, so all three
actions emit a well-formed base_file for every supported input shape
(git ref, local path, http/s URL).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test.yaml had grown to 863 lines and 22 jobs covering all four
actions. Split it into one workflow per action (test-diff,
test-breaking, test-changelog, test-pr-comment) so each file maps to
the action it exercises and stays readable.

Pure move: the jobs are byte-identical to the original set; only the
file boundaries and the per-file name/on: headers are new.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the breaking/changelog equivalents of the existing pr-comment
free-review-URL jobs: assert a URL-shaped base survives intact in
base_file= (the regression this PR fixes) and a git-ref base is
stripped to a bare path. Locks the duplicated strip_ref_prefix helper
against drift in each action.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The runner's /bin/sh is dash, which rejects `set -o pipefail` (exit 2)
that changelog/entrypoint.sh sets. Running the entrypoint directly via
its shebang therefore failed before producing any output. Invoke it
with bash, which supports pipefail (as does the busybox ash the action
uses in production). breaking/entrypoint.sh has no pipefail, so its
jobs are unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@reuvenharrison reuvenharrison merged commit ece29bd into main May 23, 2026
56 of 57 checks passed
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