You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncfunctionisLabelPresent(context,label){constissue_number=context.payload.issue.numberconstowner=context.payload.repository.owner.loginconstrepo=context.payload.repository.nameconsole.log(`isLabelPresent : ${owner}/${repo}#${issue_number} `)constlabels=awaitcontext.octokit.issues.listLabelsOnIssue({owner: owner,repo: repo,issue_number: issue_number})for(leti=0;i<labels.data.length;i++){if(labels.data[i].name===label){console.log("Label "+label+" is already set")returntrue;}}console.log("Label "+label+" is not set")returnfalse;}
As soon as I call "listLabelsOnIssue", I get a 404 error because the variable issue_number is not used. However, the console.log shows me the owner, the repo and the issue_number (ex: isLabelPresent: RubxKube/charts#4).
RequestError [HttpError]: Not Found
at /home/kiko/Documents/RubxKube/markdownify/node_modules/probot/node_modules/@octokit/request/dist-node/index.js:86:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async sendRequestWithRetries (/home/kiko/Documents/RubxKube/markdownify/node_modules/@octokit/auth-app/dist-node/index.js:398:12)
at async Job.doExecute (/home/kiko/Documents/RubxKube/markdownify/node_modules/bottleneck/light.js:405:18) {
status: 404,
response: {
url: 'https://api.github.com/repos/RubxKube/charts/issues//labels',
status: 404,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
connection: 'close',
'content-encoding': 'gzip',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Fri, 30 Jun 2023 20:26:44 GMT',
...
Expected behavior/code
I'd like to check if a label is setted or not on a pull request. My function should be return True or False.
Environment
Probot version(s): 12.3.1
Node/npm version: Node.js v18.16.1
OS: Pop OS
Possible Solution
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered:
Bug Report
Current Behavior
Here is my code:
As soon as I call "listLabelsOnIssue", I get a 404 error because the variable issue_number is not used. However, the console.log shows me the owner, the repo and the issue_number (ex:
isLabelPresent: RubxKube/charts#4
).Expected behavior/code
I'd like to check if a label is setted or not on a pull request. My function should be return True or False.
Environment
Possible Solution
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: