Skip to content

Commit 8b0c5c1

Browse files
committed
fix(updater): URL-encode existing-PR query params; add changelog entry
PR branches derived from CMake dependency paths can contain '#', which the previous query-string concatenation would treat as a URL fragment delimiter and truncate. Switch to `gh api -X GET -f` so gh URL-encodes the values, ensuring existing PRs are still matched when the branch name contains special characters. Also add the changelog entry for this PR so the advisory danger check passes.
1 parent c32ccc1 commit 8b0c5c1

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Fixes
1212

13+
- Complete script injection hardening across all actions: move remaining step outputs to env vars, validate Danger version against semver ([#152](https://github.com/getsentry/github-workflows/pull/152))
1314
- Updater - Trigger CI for new PRs without changelog updates ([#166](https://github.com/getsentry/github-workflows/pull/166))
1415
- Updater - Select the first branch when multiple branches point at `HEAD` ([#165](https://github.com/getsentry/github-workflows/pull/165))
1516

updater/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,14 @@ runs:
325325
BASE_BRANCH: ${{ steps.root.outputs.baseBranch }}
326326
PR_BRANCH: ${{ steps.root.outputs.prBranch }}
327327
run: |
328-
$apiUrl = 'repos/${{ github.repository }}/pulls?base=' + $env:BASE_BRANCH + '&head=${{ github.repository_owner }}:' + $env:PR_BRANCH
329-
$urls = @(gh api $apiUrl --jq '.[].html_url')
328+
# Use -f to let gh URL-encode query params; PR branch can contain '#' from CMake dependency paths.
329+
$head = '${{ github.repository_owner }}:' + $env:PR_BRANCH
330+
$base = $env:BASE_BRANCH
331+
$urls = @(gh api 'repos/${{ github.repository }}/pulls' `
332+
-X GET `
333+
-f ('base=' + $base) `
334+
-f ('head=' + $head) `
335+
--jq '.[].html_url')
330336
if ($urls.Length -eq 0)
331337
{
332338
'url=' | Tee-Object $env:GITHUB_OUTPUT -Append

0 commit comments

Comments
 (0)