File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ import GitHelper from "./lib/git.js";
1010import DGitHelper from "./lib/dgit.js" ;
1111import LineHelper from "./lib/line.js" ;
1212import Arweave from "arweave" ;
13- import { getRefsOnArweave , pushGitObject , updateRef } from "./lib/arweave.js" ;
13+ import {
14+ getRefsOnArweave ,
15+ pushGitObject ,
16+ updateRef ,
17+ parseArgitRemoteURI ,
18+ } from "./lib/arweave.js" ;
1419
1520const _timeout = async ( duration ) => {
1621 return new Promise ( ( resolve , reject ) => {
@@ -256,24 +261,15 @@ export default class Helper {
256261 // checking permissions
257262 try {
258263 spinner = ora ( `Checking permissions over ${ this . address } ` ) . start ( ) ;
264+ // check push permission for repo
265+ const address = await this . _arweave . wallets . jwkToAddress ( this . wallet ) ;
266+ const { repoOwnerAddress } = parseArgitRemoteURI ( this . url ) ;
259267
260- if (
261- true // check owner permission for repo
262- ) {
263- spinner . succeed ( `You have open PR permission over ${ this . address } ` ) ;
264- } else {
265- spinner . fail (
266- `You do not have open PR permission over ${ this . address } `
267- ) ;
268- this . _die ( ) ;
269- }
270- if (
271- true // check push permissions
272- ) {
268+ if ( address === repoOwnerAddress ) {
273269 spinner . succeed ( `You have push permission over ${ this . address } ` ) ;
274270 } else {
275271 spinner . fail (
276- `You do not have push permission over ${ this . address } . Try to run 'git dgit pr open' to open a push request. `
272+ `You do not have push permission over ${ this . address } .`
277273 ) ;
278274 this . _die ( ) ;
279275 }
You can’t perform that action at this time.
0 commit comments