Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#28) Add rule to disallow icon URL using GitHub links #57

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

This introduces a new requirement rule that flags any icon URL that
makes use of GitHub, either usercontent, gists or the main domain as
well as the rawgit domain that is no longer possible to use properly.

Motivation and Context

We want a rule that flags and prevents using GitHub raw urls.

Testing

  1. Create a new nuspec using choco new.
  2. Update the Icon URL to be https://github.com/chocolatey-community/chocolatey-packages/blob/master/icons/7zip.svg
  3. Run choco pack against the created nuspec.
  4. Verify the rule ID CPMR0076 is flagged and shown in the console.
  5. Repeat 2-4 using the URL https://github.com/chocolatey-community/chocolatey-packages/raw/refs/heads/master/icons/filezilla.svg
  6. Repeat 2-4 using the RUL https://raw.githubusercontent.com/chocolatey-community/chocolatey-packages/refs/heads/master/icons/1password4.png
  7. Repeat 2-4 using the URL https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/049a3a3d/icons/winff.png

Operating Systems Testing

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Fixes #28

@AdmiringWorm AdmiringWorm self-assigned this Dec 5, 2024
@AdmiringWorm AdmiringWorm requested a review from gep13 December 5, 2024 13:47
…links

This introduces a new requirement rule that flags any icon URL that
makes use of GitHub, either usercontent, gists or the main domain as
well as the rawgit domain that is no longer possible to use properly.
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit 422fa4f into chocolatey-community:develop Dec 5, 2024
1 check passed
@gep13
Copy link
Member

gep13 commented Dec 5, 2024

@AdmiringWorm thanks for getting this fixed up!

@AdmiringWorm AdmiringWorm deleted the issue28 branch December 11, 2024 09:36
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.

Add validation rule to disallow icon URL using GitHub raw links
2 participants