File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11import { z } from "astro:schema" ;
22import { getCollection } from "astro:content" ;
33import { type CollectionEntry } from "astro:content" ;
4+ import { readFile } from "fs/promises" ;
45
56export async function getChangelogs ( opts ?: {
67 filter ?: Parameters < typeof getCollection < "changelogs" > > [ 1 ] ;
@@ -60,8 +61,21 @@ export async function getChangelogs(opts?: {
6061export async function getWranglerChangelog ( ) : Promise <
6162 CollectionEntry < "changelogs" >
6263> {
64+ let authHeaders = { } ;
65+
66+ readFile ( "assets/secrets/github_tokens.txt" , { encoding : "utf8" } )
67+ . then ( ( data ) => {
68+ authHeaders = { Authorization : `Bearer ${ data . trim ( ) } ` } ;
69+ } )
70+ . catch ( ( _ ) => {
71+ // console.log(
72+ // "[GetWranglerChangelog] Info: No GitHub token found.",
73+ // );
74+ } ) ;
75+
6376 const response = await fetch (
6477 "https://api.github.com/repos/cloudflare/workers-sdk/releases" ,
78+ { headers : authHeaders } ,
6579 ) ;
6680
6781 if ( ! response . ok ) {
You can’t perform that action at this time.
0 commit comments