Skip to content

Add -asset flag to filter release assets by filename pattern#62

Merged
Songmu merged 1 commit intoSongmu:mainfrom
fujiwara:add-asset-filter
Mar 5, 2026
Merged

Add -asset flag to filter release assets by filename pattern#62
Songmu merged 1 commit intoSongmu:mainfrom
fujiwara:add-asset-filter

Conversation

@fujiwara
Copy link
Copy Markdown
Contributor

@fujiwara fujiwara commented Mar 5, 2026

When a release contains non-archive assets (e.g. .rpm, .deb) alongside .tar.gz/.zip, maltmill could pick the wrong file. The -asset flag accepts a regexp pattern to select which assets to consider.

When a release contains non-archive assets (e.g. .rpm, .deb) alongside
.tar.gz/.zip, maltmill could pick the wrong file. The -asset flag accepts
a regexp pattern to select which assets to consider.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an -asset CLI flag to restrict which GitHub release assets are considered (by filename regexp), preventing selection of non-archive assets when updating/creating formulae.

Changes:

  • Parse and propagate -asset (regexp) through maltmill and new command flows.
  • Filter release assets in getDownloads based on the provided pattern.
  • Add unit tests for arg parsing and asset filtering; document the new flag in the README.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cli.go Adds -asset flag parsing/validation and forwards it to the new subcommand.
cmd_maltmill.go Stores and passes the compiled asset regexp into formula processing.
formula.go Plumbs the asset regexp into release asset selection during formula updates.
cmd_new.go Extends getDownloads to filter assets by filename regexp and threads the option through new.
cli_test.go Adds coverage ensuring -asset is parsed for both main and new flows.
formula_test.go Adds coverage for getDownloads behavior with/without an asset filter.
README.md Documents -asset usage and adds it to options tables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread cmd_new.go
Comment thread cli.go
Comment thread cli.go
@Songmu Songmu merged commit 7a32c2b into Songmu:main Mar 5, 2026
5 checks passed
@Songmu Songmu added the minor label Mar 5, 2026
@github-actions github-actions bot mentioned this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants