diff --git a/.changeset/loud-elephants-reflect.md b/.changeset/loud-elephants-reflect.md new file mode 100644 index 000000000..717cabc98 --- /dev/null +++ b/.changeset/loud-elephants-reflect.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/github-proxy': minor +--- + +Add recursive=true query string to Github Proxy to allow nested tree search diff --git a/typescript/github-proxy/README.md b/typescript/github-proxy/README.md new file mode 100644 index 000000000..498b204ca --- /dev/null +++ b/typescript/github-proxy/README.md @@ -0,0 +1,23 @@ +# Github Proxy + +## Overview + +Github Proxy is a CloudFlare Worker that makes a Github API requests using an API key. This authenticated method allows higher limits than the non-authenticated mode. + +## Keys + +Acquire a Github api key by creating a new [fine-grained personal access token](https://github.com/settings/tokens). + +## Local Development + +Prerequisites: Copy the `.dev.vars.example` and add the Github API key. + +Development is managed by the Wrangler CLI. To start dev mode execute `yarn dev`. This will start a local server. + +## Testing + +Unit tests can be executed using `yarn test`. + +## Deployment + +Execute `yarn deploy` to deploy to production. Note that the deployment requires permissions. To deploy to a staging environment use `yarn deploy:staging`. Use `yarn deploy:key` to attach the Github key to the Worker. diff --git a/typescript/github-proxy/src/index.ts b/typescript/github-proxy/src/index.ts index 500c96426..e1de8a2c5 100644 --- a/typescript/github-proxy/src/index.ts +++ b/typescript/github-proxy/src/index.ts @@ -12,7 +12,7 @@ export default { return new Response(DISALLOWED_URL_MSG, { status: 401 }); } - const apiUrl = new URL(`${GITPUB_API_HOST}${apiUrlPath}`); + const apiUrl = new URL(`${GITPUB_API_HOST}${apiUrlPath}?recursive=true`); return fetch(apiUrl, { method: 'GET', headers: {