auto-close-issues
auto-close-issues copied to clipboard
Action completes successfully but issue is not closed
Hi,
first of all, thanks for this project. I was trying to use it since i am trying to get familiar wit it and Github actions.
Seems everything worked but the result is not the expected like the title says. The logs shows me this:
2020-03-27T16:24:48.7041862Z ##[section]Starting: Request a runner to run this job
2020-03-27T16:24:48.8900387Z Requesting a hosted runner in current repository's account/organization with labels: 'ubuntu-latest', require runner match: True
2020-03-27T16:24:48.9791717Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2020-03-27T16:24:49.0479289Z ##[section]Finishing: Request a runner to run this job
2020-03-27T16:24:56.7014831Z Current runner version: '2.165.2'
2020-03-27T16:24:56.7015947Z Prepare workflow directory
2020-03-27T16:24:56.7201290Z Prepare all required actions
2020-03-27T16:24:56.7211954Z Download action repository 'lucasbento/[email protected]'
2020-03-27T16:24:58.0374262Z ##[group]Run lucasbento/[email protected]
2020-03-27T16:24:58.0374671Z with:
2020-03-27T16:24:58.0375143Z github-token: ***
2020-03-27T16:24:58.0375431Z issue-close-message: Hello @davidmpaz! :wave:
This issue is being automatically closed because it does not follow the issue template.
2020-03-27T16:24:58.0375721Z closed-issues-label: 🙠Not following issue template
2020-03-27T16:24:58.0375963Z ##[endgroup]
2020-03-27T16:24:58.4537195Z (node:2514) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, scandir '.github/ISSUE_TEMPLATE'
2020-03-27T16:24:58.4537543Z at Object.readdirSync (fs.js:854:3)
2020-03-27T16:24:58.4538034Z at /home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:10051:29
2020-03-27T16:24:58.4538609Z at Object.676 (/home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:10128:3)
2020-03-27T16:24:58.4539144Z at __webpack_require__ (/home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:22:30)
2020-03-27T16:24:58.4539634Z at startup (/home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:37:19)
2020-03-27T16:24:58.4540101Z at /home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:43:18
2020-03-27T16:24:58.4540612Z at Object.<anonymous> (/home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:46:10)
2020-03-27T16:24:58.4540885Z at Module._compile (internal/modules/cjs/loader.js:959:30)
2020-03-27T16:24:58.4541147Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
2020-03-27T16:24:58.4541407Z at Module.load (internal/modules/cjs/loader.js:815:32)
2020-03-27T16:24:58.4544762Z (node:2514) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-03-27T16:24:58.4545900Z (node:2514) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2020-03-27T16:24:58.4571786Z Cleaning up orphan processes
Any idea about it? Thanks in advance and best regards, David
Hello @davidmpaz, it seems like it can't find the .github/ISSUE_TEMPLATE
folder, can you tell me where that folder is located in your project?
Hi 👋 @lucasbento,
thanks for your response! I did generate the issues templates with the built in functionality from Github, i can also confirm that they are in the expected directory .github/ISSUE_TEMPLATE
. the paths to the templates are:
.github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md
and the content of the templates are the default content that was generated, i haven't change anything.
Best regards, David
@davidmpaz: sorry for the delay, being swamped in work.
Would you be able to provide a reproduction repository so I can take a look and test some stuff out?
To me the problem seems to be that the issue-close-message
is a multiline string. Before I changed the string to be multi-line the bot worked great. Then I changed it and now it's not working anymore.
Here's the configuration which breaks.
The log is:
2020-04-07T09:45:31.5595495Z ##[group]Run lucasbento/[email protected]
2020-04-07T09:45:31.5595616Z with:
2020-04-07T09:45:31.5596080Z github-token: ***
2020-04-07T09:45:31.5596278Z issue-close-message: I'm the annoying robot who closes your issue because I believe you didn't follow the issue template.
If you just came here to ask a question,
please join the [Network To Code][http://slack.networktocode.com/] Slack (it's free) and
ask for help in our [`#netbox-docker` channel][https://slack.com/app_redirect?channel=netbox-docker&team=T09LQ7E9E].
They're usually more supportive than I am :innocent:.
2020-04-07T09:45:31.5596443Z closed-issues-label: invalid
2020-04-07T09:45:31.5596521Z ##[endgroup]
2020-04-07T09:45:32.8416707Z (node:2670) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected identifier
2020-04-07T09:45:32.8437367Z at Function (<anonymous>)
2020-04-07T09:45:32.8438958Z at getIssueCloseMessage (/home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:10035:17)
2020-04-07T09:45:32.8439288Z at /home/runner/work/_actions/lucasbento/auto-close-issues/v1.0.2/dist/index.js:10118:11
2020-04-07T09:45:32.8440053Z at processTicksAndRejections (internal/process/task_queues.js:93:5)
2020-04-07T09:45:32.8440593Z (node:2670) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-04-07T09:45:32.8441382Z (node:2670) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2020-04-07T09:45:32.8458016Z Cleaning up orphan processes
@cimnine: this is an error with your YAML format, try this: https://stackoverflow.com/a/3790497/4252781.
Please open another issue if that doesn't work as it's not the same problem as OP is having.
There's no problem with my yaml:
See https://yaml-multiline.info/ for the various ways how yaml supports multiline strings.
I believe the problem is here: https://github.com/lucasbento/auto-close-issues/blob/master/src/index.js#L18
If you pass in a multi-line string, this line breaks. Try it!
Please open another issue if that doesn't work as it's not the same problem as OP is having.
Well to me it does seem it's the same issue. See his log:
2020-03-27T16:24:58.0375431Z issue-close-message: Hello @davidmpaz! :wave:
This issue is being automatically closed because it does not follow the issue template.
Clearly a multi-line string here. Looks like my log.
Good eye, totally missed that, sorry about it.
I'll investigate this today.
Please @lucasbento, check the pull request on the repo i did invite you.
It is not public yet, but I will release it after I finished playing around with it.
Thanks in advance
Will do, thank you @davidmpaz!
Can confirm it doesn't work.
I've created a fork with debugging information that helped me fix this: https://github.com/marcelklehr/auto-close-issues (use @ master)