Code Monkey home page Code Monkey logo

Comments (8)

svsool avatar svsool commented on May 30, 2024 4

Got the same problem https://github.com/svsool/vscode-memo/runs/1336476423 (debug enabled).

Looks like it's coming from conventional-commits-parser:

⇣6% ❯ node index.js
.../node_modules/conventional-commits-parser/lib/parser.js:152
    while (!header.trim()) {
                   ^

TypeError: Cannot read property 'trim' of undefined
    at parser (.../node_modules/conventional-commits-parser/lib/parser.js:152:20)
    at sync (.../node_modules/conventional-commits-parser/index.js:97:10)
    at Object.<anonymous> (/index.js:7:13)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

Here is the way to repro it:

const { sync } = require("conventional-commits-parser");

console.log(
  sync("Merge pull request #134 from mgmeyers/syntax-decor-flag", {
    mergePattern: "^Merge pull request #(.*) from (.*)$",
    mergeCorrespondence: ["issueId", "source"],
  })
);

Perhaps parser expects multiline message for merge commits. I amended the commit message with two lines instead of one, and build went through.

Not sure if it should be reported to the author of conventional-commits-parser or parsing of merge commit messages can be disabled as part of the action logic.

I also noticed that you mutate imported options here, probably spread can be used instead.

from actions.

marvinpinto avatar marvinpinto commented on May 30, 2024

Hey @robinvanpoppel! Could you enable debug logging on that build? I suspect it's getting stuck somewhere in this function but I'm not certain.

I'll try and have a look at this sometime next week.

from actions.

robinvanpoppel avatar robinvanpoppel commented on May 30, 2024

@marvinpinto, thanks for your quicky reply. I was not aware of the debug option. Thanks for pointing that out :)

The project containing this action was not mine, so I do not have access to the settings. I did try reproducing it my own fork. Unfortunately this did not happen over there.
I retagged a later commit in the original repository , but the release now succeeds there as well. I'll update this issue if I experience it again.

from actions.

marvinpinto avatar marvinpinto commented on May 30, 2024

Sounds great, I'll close this for now but re-open if need be 👍

from actions.

Async0x42 avatar Async0x42 commented on May 30, 2024

I've been getting a similar error from an automated dependabot pull-request for sharepointplus-loader.

Here's the trimmed debug for the relevant portion, let me know if you need anything else:

 ##[debug]Searching for pull requests associated with commit dc4b8e6e40624f59f645775899e9ec52f851a7f0
  ##[debug] request {"method":"GET","baseUrl":"https://api.github.com","headers":{"accept":"application/vnd.github.groot-preview+json","user-agent":"octokit.js/16.33.0 Node.js/12.13.1 (Linux 5.0; x64)","authorization":"token ***"},"mediaType":{"format":"","previews":[]},"request":{"validate":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}}},"url":"/repos/:owner/:repo/commits/:commit_sha/pulls","owner":"Async0x42","repo":"collaborative-sharepoint-calendar","commit_sha":"dc4b8e6e40624f59f645775899e9ec52f851a7f0"}
  ##[debug] GET /repos/Async0x42/collaborative-sharepoint-calendar/commits/dc4b8e6e40624f59f645775899e9ec52f851a7f0/pulls - 200 in 234ms
  Found 1 pull request(s) associated with commit dc4b8e6e40624f59f645775899e9ec52f851a7f0
  ##[debug]Changelog options: {"parserOpts":{"headerPattern":{},"headerCorrespondence":["type","scope","subject"],"noteKeywords":["BREAKING CHANGE"],"revertPattern":{},"revertCorrespondence":["header","hash"]},"mergePattern":"^Merge pull request #(.*) from (.*)$","mergeCorrespondence":["issueId","source"]}
  ##[error]Cannot read property 'trim' of undefined
  (node:4476) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'trim' of undefined
      at e.exports (/home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:572296)
      at Function.e.exports.sync (/home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:570888)
      at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:222656
      at Generator.next (<anonymous>)
      at s (/home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:221551)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
  (node:4476) 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)
  (node:4476) [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.
  ##[debug]Node Action run completed with exit code 1
  ##[debug]Finishing: Run marvinpinto/action-automatic-releases@latest

from actions.

robinvanpoppel avatar robinvanpoppel commented on May 30, 2024

If it helps: in our repo we also use dependabot, so it might have to do with that, though I haven't experienced it ever since.

from actions.

vasekbrychta avatar vasekbrychta commented on May 30, 2024

I'm having the same issue, it fails on the merge commit for dependabot pull request. Just an idea, I'm not sure if it might be related or not, but the original branch that dependabot created is deleted.
And another detail - it didn't happen before when I was merging the pull requests manually; it happened on first merge that was done by the dependabot instead of me (I commented the pull request with "@dependabot merge").

from actions.

Vadorequest avatar Vadorequest commented on May 30, 2024

@marvinpinto This issue should be re-opened until conventional-changelog/conventional-changelog#757 is merged (related to conventional-changelog/conventional-changelog#691)

Also, #65 is a duplicate of this issue.

from actions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.