feat: added choco as a package manager for windows users - #606
feat: added choco as a package manager for windows users#606junaid2005p wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe release workflow now passes the Chocolatey API key to GoReleaser. GoReleaser now packages and publishes Surge to Chocolatey. Windows installation instructions now include Chocolatey. ChangesChocolatey release packaging
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant GoReleaser
participant Chocolatey
GitHubActions->>GoReleaser: Provide CHOCOLATEY_API_KEY
GoReleaser->>Chocolatey: Publish surge package
Chocolatey-->>GoReleaser: Return publish result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.goreleaser.yaml:
- Line 62: Update the icon_url configuration to use a jsDelivr CDN URL instead
of raw.githubusercontent.com, and pin the referenced logo asset to a specific
release tag or commit rather than the mutable main branch.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 446b0687-223c-4eef-8514-0d21dc29a70b
📒 Files selected for processing (3)
.github/workflows/core-build.yml.goreleaser.yamlREADME.md
| title: Surge | ||
| project_url: https://github.com/SurgeDM/Surge | ||
| url_template: "https://github.com/SurgeDM/Surge/releases/download/{{ .Tag }}/{{ .ArtifactName }}" | ||
| icon_url: https://raw.githubusercontent.com/SurgeDM/Surge/main/assets/logo.png |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
file=".goreleaser.yaml"
if [ -f "$file" ]; then
cat -n "$file" | sed -n '35,70p'
else
printf '%s\n' "$file not found"
fiRepository: SurgeDM/Surge
Length of output: 1562
🌐 Web query:
Chocolatey CPMR0076 raw.githubusercontent.com icon_url supported CDN URL official documentation
💡 Result:
The Chocolatey rule CPMR0076 identifies that a package's iconUrl is improperly hotlinking to a raw GitHub URL (e.g., raw.githubusercontent.com) [1]. Chocolatey's official documentation and moderation policies prohibit the use of raw GitHub links for package icons because GitHub is not intended to serve as a content delivery network (CDN) for static assets [1][2]. When a package is submitted or updated, the validation process will trigger this rule if the iconUrl points to such a domain [1]. To remediate this issue, maintainers are required to host the icon on a proper, static CDN [1]. The documentation suggests using services like jsDelivr or Statically, which are commonly used by package maintainers to serve files hosted on GitHub while complying with the repository requirements [1][2]. Furthermore, maintainers should ensure the icon is hosted at a location under their control [2][3]. It is also recommended to use a specific tag or commit URL rather than a branch URL to ensure the icon remains stable and is not subject to unexpected changes [2].
Citations:
- 1: https://docs.chocolatey.org/en-us/community-repository/moderation/package-validator/rules/cpmr0076/
- 2: https://docs.chocolatey.org/en-us/create/create-packages/
- 3: https://docs.chocolatey.org/en-us/community-repository/moderation/
🏁 Script executed:
#!/bin/bash
set -eu
for url in \
"https://docs.chocolatey.org/en-us/community-repository/moderation/package-validator/rules/cpmr0076/" \
"https://cdn.jsdelivr.net/gh/SurgeDM/Surge@main/assets/logo.png" \
"https://raw.githubusercontent.com/SurgeDM/Surge/main/assets/logo.png"
do
printf '\n%s\n' "$url"
curl -L -sS -o /dev/null -w 'HTTP %{http_code}, final URL: %{url_effective}\n' "$url"
doneRepository: SurgeDM/Surge
Length of output: 681
🌐 Web query:
site:docs.chocolatey.org/en-us/community-repository/moderation/package-validator/rules/cpmr0076 iconUrl raw.githubusercontent.com jsDelivr tag commit
💡 Result:
You should avoid using raw.githubusercontent.com for icon URLs because GitHub does not intend for its raw file links to be used as a content delivery network (CDN) for hotlinking [1]. Instead, you should use a dedicated CDN provider like jsDelivr to serve these assets reliably [1]. To use jsDelivr with a GitHub repository, you can follow their standard URL structure for GitHub, which replaces the need for raw.githubusercontent.com links. The general format for a jsDelivr URL targeting a GitHub repository is: https://cdn.jsdelivr.net/gh/user/repo@version/path/to/file In this structure: user is your GitHub username. repo is the repository name. @version allows you to specify a tag, a branch name, or a specific commit hash. path/to/file is the path to your icon within the repository. Using this format ensures that your assets are properly cached and served through the CDN rather than directly from GitHub's raw file servers [1].
Citations:
- 1: https://docs.chocolatey.org/en-us/community-repository/moderation/package-validator/rules/cpmr0076/
Use a CDN-backed, versioned icon URL.
Chocolatey CPMR0076 rejects raw.githubusercontent.com icon URLs. Replace it with a jsDelivr URL that uses a release tag or commit instead of the mutable main branch.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.goreleaser.yaml at line 62, Update the icon_url configuration to use a
jsDelivr CDN URL instead of raw.githubusercontent.com, and pin the referenced
logo asset to a specific release tag or commit rather than the mutable main
branch.
Summary by CodeRabbit
New Features
Documentation