Merge pull request #513 from liedekef/patch-1
Fix release asset filtering bug and treat `main` as a default branch.
This commit is contained in:
commit
7457e85680
|
|
@ -114,7 +114,7 @@ if ( !class_exists(GitHubApi::class, false) ):
|
||||||
if ( $this->releaseAssetsEnabled ) {
|
if ( $this->releaseAssetsEnabled ) {
|
||||||
//Use the first release asset that matches the specified regular expression.
|
//Use the first release asset that matches the specified regular expression.
|
||||||
if ( isset($release->assets, $release->assets[0]) ) {
|
if ( isset($release->assets, $release->assets[0]) ) {
|
||||||
$matchingAssets = array_filter($release->assets, array($this, 'matchesAssetFilter'));
|
$matchingAssets = array_values(array_filter($release->assets, array($this, 'matchesAssetFilter')));
|
||||||
} else {
|
} else {
|
||||||
$matchingAssets = array();
|
$matchingAssets = array();
|
||||||
}
|
}
|
||||||
|
|
@ -358,7 +358,7 @@ if ( !class_exists(GitHubApi::class, false) ):
|
||||||
protected function getUpdateDetectionStrategies($configBranch) {
|
protected function getUpdateDetectionStrategies($configBranch) {
|
||||||
$strategies = array();
|
$strategies = array();
|
||||||
|
|
||||||
if ( $configBranch === 'master' ) {
|
if ( $configBranch === 'master' || $configBranch === 'main') {
|
||||||
//Use the latest release.
|
//Use the latest release.
|
||||||
$strategies[self::STRATEGY_LATEST_RELEASE] = array($this, 'getLatestRelease');
|
$strategies[self::STRATEGY_LATEST_RELEASE] = array($this, 'getLatestRelease');
|
||||||
//Failing that, use the tag with the highest version number.
|
//Failing that, use the tag with the highest version number.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue