Skip to content

Conversation

@rsd76
Copy link

@rsd76 rsd76 commented Oct 28, 2025

This is a new bridge for github packages. Specify organization/owner, repository, package and package type.

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

Pull request artifacts

Bridge Context Status
GithubPackages 1 untitled (pr) ✔️

last change: Thursday 2026-01-15 18:47:59

@Mynacol Mynacol added the Bridge-Request Request for a new bridge label Oct 31, 2025
Copy link
Contributor

@Mynacol Mynacol left a comment

Choose a reason for hiding this comment

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

Please polish the bridge a bit more, see my suggestions and comments. Otherwise a good contribution.

Copy link
Contributor

@Mynacol Mynacol left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my previous points. Upon revisiting, I found some logic errors in some cases. After addressing these, this bridge will be great ✨.
For additional testing, you can use https://github.com/orgs/curl/packages?repo_name=curl-container.

Change $plaintext to a string.
Copy link
Contributor

@Mynacol Mynacol left a comment

Choose a reason for hiding this comment

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

Thanks, some more cleanups attached.

I hope my reviews are not too annoying. I guess we are mostly done now.

Copy link
Contributor

@Mynacol Mynacol left a comment

Choose a reason for hiding this comment

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

Thanks a lot, I found some new minor nitpicks and have some questions to you. We're definitely converging.

'NuGet' => 'nuget',
'RubyGems' => 'rubygems'
],
'defaultValue' => 'container',
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally, we set the default value to the most inclusive option. However, here, specifying "All" only works if we don't provide a specific package. So any of the other options is a "safer" option. And among them, I guess containers are the most popular one. What do you think?

Suggested change
'defaultValue' => 'container',
'defaultValue' => 'all',

return self::URI
. urlencode($this->getInput('organization'));
} else {
return 'https://github.com/RSS-Bridge/rss-bridge';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change this to return an error/null as well. It should not happen anyways (as it's called from functions that already require an organization)?

$published = ($div->find('relative-time[class=no-wrap]'))[0];
$this->items[] = [
'title' => $a->plaintext,
'uri' => 'https://github.com' . $a->href,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is something speaking against using defaultLinkTo (shortly after getSimpleHTMLDOM)? That would reduce the chances of bugs.
https://rss-bridge.github.io/rss-bridge/Helper_functions/index.html#defaultlinkto

Suggested change
'uri' => 'https://github.com' . $a->href,
'uri' => $a->href,

if (preg_match('/[0-9]+ (hour|hours|day|days|week|weeks|month|months|year|years) ago/', $published->plaintext, $ago)) {
$this->items[] = [
'title' => $a->plaintext,
'uri' => 'https://github.com' . $a->href,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, can probably be simplified in favor of defaultLinkTo.

Suggested change
'uri' => 'https://github.com' . $a->href,
'uri' => $a->href,

return parent::getName();
}

public function getUri()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you have to urlencode the elements (in particular the packagename) to match the behavior of getPackageUri and to suit GitHub.

(e.g. the package curl-container/curl-dev-debian has the URI https://github.com/curl/curl-container/pkgs/container/curl-container%2Fcurl-dev-debian with urlencoded package name and changing %2F to a slash teads to a 404 error)

{
if (!empty($this->getInput('organization')) && !empty($this->getInput('repository')) && !empty($this->getInput('packagename'))) {
if ($this->getInput('packagetype') === 'all') {
throwClientException('Do not provide package type as "all", when specifying a package name.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throwClientException('Do not provide package type as "all", when specifying a package name.');
throwClientException('Do not provide package type as "all" when specifying a package name.');

. '/packages?ecosystem='
. urlencode($this->getInput('packagetype'));
} else {
throwClientException('Provide an organization with optional a repository and package name.');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think my working is shorter and also clear. What do you think?

Suggested change
throwClientException('Provide an organization with optional a repository and package name.');
throwClientException('Provide at least an organization.');

@Mynacol
Copy link
Contributor

Mynacol commented Jan 15, 2026

And for the future, the following GitHub organization has sample repos with each package type in the GitHub package registry: https://github.com/orgs/github-packages-examples/repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bridge-Request Request for a new bridge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants