Skip to content

Commit 1cc5f44

Browse files
committed
fix: send either EGLNOPERMISSION or EINVALIDGLTOKEN but not both
1 parent 4a1059e commit 1cc5f44

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/verify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ module.exports = async (pluginConfig, context) => {
5353
json: true,
5454
headers: {'Private-Token': gitlabToken},
5555
}));
56+
57+
if (!((projectAccess && projectAccess.access_level >= 30) || (groupAccess && groupAccess.access_level >= 30))) {
58+
errors.push(getError('EGLNOPERMISSION', {repoId}));
59+
}
5660
} catch (error) {
5761
if (error.statusCode === 401) {
5862
errors.push(getError('EINVALIDGLTOKEN', {repoId}));
@@ -62,10 +66,6 @@ module.exports = async (pluginConfig, context) => {
6266
throw error;
6367
}
6468
}
65-
66-
if (!((projectAccess && projectAccess.access_level >= 30) || (groupAccess && groupAccess.access_level >= 30))) {
67-
errors.push(getError('EGLNOPERMISSION', {repoId}));
68-
}
6969
} else {
7070
errors.push(getError('ENOGLTOKEN', {repoId}));
7171
}

0 commit comments

Comments
 (0)