Repository navigation
ci: Restore Socket Firewall with PUBLIC_SOCKET_FIREWALL_TOKEN - #50
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
Prompt hidden (unlisted session) |
There was a problem hiding this comment.
Devin Review found 1 finding. It is left for you to triage below.
| uses: workos/setup-socket-firewall@ca93dd8aa351f54f4729fe3377a9be23c631c25d | ||
| with: | ||
| token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }} | ||
| configure-bun: true |
There was a problem hiding this comment.
🟡 Fork pull requests fail release validation
On external fork PRs, setup-socket-firewall receives an empty token because GitHub withholds repository secrets. Both build and pack-check omit allow-external-fork-fallback, so the action rejects the missing token. All four binary builds and the tarball self-check fail before dependency installation.
Devin left this for you to triage: This is real: release.yml's build and pack-check jobs run on pull requests, so fork PRs would fail there. The fix is to add allow-external-fork-fallback: true to those two setup-socket-firewall steps and leave the publish step as it is. It's held until Matt OKs pushing to his PR.
Learn more
The pinned action defaults allow-external-fork-fallback to false. Its setup script rejects an empty token unless that input is enabled and the event is an external pull request against a public repository. GitHub withholds repository secrets from fork PRs regardless of the secret's name. The pack-check job has the same omission, while lint and test already enable the fallback.
Example: A contributor opens a PR from alice/quickstudy into the public upstream repository. The token resolves to an empty string, so all four binary builds and the tarball self-check fail during Socket Firewall setup instead of validating the contribution.
Recommended fix: Set allow-external-fork-fallback: true on both the build and pack-check setup steps. The action independently limits fallback to public external-fork pull requests, preserving fail-closed behavior for release publishing.
Was this helpful? React with 👍 or 👎 to provide feedback.
[Medium impact] The changes reach CI checks and the release workflow's package-download and publishing paths. Add the fork fallback to both release checks before merging. FindingsFix with agent prompt### Issue 1
.github/workflows/release.yml:98-100
**Fork release checks lack fallback.** `release.yml` also runs on `pull_request`, but neither this setup step nor the one in `pack-check` enables `allow-external-fork-fallback`. External fork runs receive no repository secrets, regardless of the `PUBLIC_` prefix, so these jobs lack the token needed for setup and cannot reach their build checks. Add the same fallback used in lint and test to both PR-facing setup steps.
### Issue 2
scripts/sfw-macos-getent.sh:117-122
**Restore the helper tests too.** This brings back the macOS helper without the tests that previously covered it in `tests/ci-sfw-release.test.ts`. Restore the helper-specific cases for IPv4/IPv6, loopback records, empty results, and failed or malformed replies. The existing `__test_getent` entry point lets these run on Linux, so bad DNS replies need not go unchecked until a macOS release build.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryRestores Socket Firewall for CI and releases using
Reviews (1) · Last reviewed commit: "ci: Restore Socket Firewall with PUBLIC_..." · Reviewed by Greptile |
| with: | ||
| token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }} | ||
| configure-bun: true |
There was a problem hiding this comment.
Fork release checks lack fallback.
release.yml also runs on pull_request, but neither this setup step nor the one in pack-check enables allow-external-fork-fallback. External fork runs receive no repository secrets, regardless of the PUBLIC_ prefix, so these jobs lack the token needed for setup and cannot reach their build checks. Add the same fallback used in lint and test to both PR-facing setup steps.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yml
Line: 98-100
Comment:
**Fork release checks lack fallback.** `release.yml` also runs on `pull_request`, but neither this setup step nor the one in `pack-check` enables `allow-external-fork-fallback`. External fork runs receive no repository secrets, regardless of the `PUBLIC_` prefix, so these jobs lack the token needed for setup and cannot reach their build checks. Add the same fallback used in lint and test to both PR-facing setup steps.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| __test_getent) | ||
| shift | ||
| [ "$#" -ge 1 ] || { usage; exit 2; } | ||
| test_dscacheutil="$1" | ||
| shift | ||
| emit_ahosts "$test_dscacheutil" "$@" |
There was a problem hiding this comment.
Restore the helper tests too. This brings back the macOS helper without the tests that previously covered it in
tests/ci-sfw-release.test.ts. Restore the helper-specific cases for IPv4/IPv6, loopback records, empty results, and failed or malformed replies. The existing __test_getent entry point lets these run on Linux, so bad DNS replies need not go unchecked until a macOS release build.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/sfw-macos-getent.sh
Line: 117-122
Comment:
**Restore the helper tests too.** This brings back the macOS helper without the tests that previously covered it in `tests/ci-sfw-release.test.ts`. Restore the helper-specific cases for IPv4/IPv6, loopback records, empty results, and failed or malformed replies. The existing `__test_getent` entry point lets these run on Linux, so bad DNS replies need not go unchecked until a macOS release build.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
#47 dropped the
workos/setup-socket-firewallsteps from lint, test, release and release-please, along withscripts/sfw-macos-getent.sh, by accident (the PR was a codex fix). This PR restores them as they were before #47.The token they read is
secrets.SOCKET_FIREWALL_TOKEN, which pull request runs can't get. They now readsecrets.PUBLIC_SOCKET_FIREWALL_TOKEN, the secret set up for this public repo, and theworkflow_callsecretrelease-please.ymlpasses torelease.ymlis renamed to match. Lint and test also setallow-external-fork-fallback: trueso fork PRs still run, the same as workos-node's CI.👀 1 finding for you to triage · Follow Devin's work