MCPcopy Create free account
hub / github.com/decaporg/decap-cms / hasWriteAccess

Method hasWriteAccess

packages/decap-cms-backend-github/src/API.ts:295–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293 }
294
295 async hasWriteAccess() {
296 try {
297 const result: Endpoints['GET /repos/{owner}/{repo}']['response']['data'] = await this.request(
298 this.repoURL,
299 );
300 // update config repoOwner to avoid case sensitivity issues with GitHub
301 this.repoOwner = result.owner.login;
302 return result.permissions?.push ?? false;
303 } catch (error) {
304 console.error('Problem fetching repo data from GitHub');
305 throw error;
306 }
307 }
308
309 reset() {
310 // no op

Callers 1

authenticateMethod · 0.45

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected