@@ -58,32 +58,38 @@ export class GitHubProvider extends BaseGitHubProvider<GithubUpdateInfo> {
58
58
try {
59
59
if ( this . updater . allowPrerelease ) {
60
60
const currentChannel = this . updater ?. channel || ( semver . prerelease ( this . updater . currentVersion ) ?. [ 0 ] as string ) || null
61
- for ( const element of feed . getElements ( "entry" ) ) {
61
+
62
+ if ( currentChannel === null ) {
62
63
// noinspection TypeScriptValidateJSTypes
63
- const hrefElement = hrefRegExp . exec ( element . element ( "link" ) . attribute ( "href" ) ) !
64
-
65
- // If this is null then something is wrong and skip this release
66
- if ( hrefElement === null ) continue
67
-
68
- // This Release's Tag
69
- const hrefTag = hrefElement [ 1 ]
70
- //Get Channel from this release's tag
71
- const hrefChannel = ( semver . prerelease ( hrefTag ) ?. [ 0 ] as string ) || null
72
-
73
- const shouldFetchVersion = ! currentChannel || [ "alpha" , "beta" ] . includes ( currentChannel )
74
- const isCustomChannel = ! [ "alpha" , "beta" ] . includes ( String ( hrefChannel ) )
75
- // Allow moving from alpha to beta but not down
76
- const channelMismatch = currentChannel === "beta" && hrefChannel === "alpha"
77
-
78
- if ( shouldFetchVersion && ! isCustomChannel && ! channelMismatch ) {
79
- tag = hrefTag
80
- break
81
- }
82
-
83
- const isNextPreRelease = hrefChannel && hrefChannel === currentChannel
84
- if ( isNextPreRelease ) {
85
- tag = hrefTag
86
- break
64
+ tag = hrefRegExp . exec ( latestRelease . element ( "link" ) . attribute ( "href" ) ) ! [ 1 ]
65
+ } else {
66
+ for ( const element of feed . getElements ( "entry" ) ) {
67
+ // noinspection TypeScriptValidateJSTypes
68
+ const hrefElement = hrefRegExp . exec ( element . element ( "link" ) . attribute ( "href" ) ) !
69
+
70
+ // If this is null then something is wrong and skip this release
71
+ if ( hrefElement === null ) continue
72
+
73
+ // This Release's Tag
74
+ const hrefTag = hrefElement [ 1 ]
75
+ //Get Channel from this release's tag
76
+ const hrefChannel = ( semver . prerelease ( hrefTag ) ?. [ 0 ] as string ) || null
77
+
78
+ const shouldFetchVersion = ! currentChannel || [ "alpha" , "beta" ] . includes ( currentChannel )
79
+ const isCustomChannel = ! [ "alpha" , "beta" ] . includes ( String ( hrefChannel ) )
80
+ // Allow moving from alpha to beta but not down
81
+ const channelMismatch = currentChannel === "beta" && hrefChannel === "alpha"
82
+
83
+ if ( shouldFetchVersion && ! isCustomChannel && ! channelMismatch ) {
84
+ tag = hrefTag
85
+ break
86
+ }
87
+
88
+ const isNextPreRelease = hrefChannel && hrefChannel === currentChannel
89
+ if ( isNextPreRelease ) {
90
+ tag = hrefTag
91
+ break
92
+ }
87
93
}
88
94
}
89
95
} else {
0 commit comments