Closed baeyun closed 4 years ago
Hey there, thanks for the input!
Could you set the secret on the repo ACTIONS_STEP_DEBUG
to true and there should be an output:
Here are the files I am changing: ...
Can you grab this so we can see what it looks like? From what I can see it should contain an array of changed files. It might either be empty, or contain some unexpected inputs/issues.
One thing I think MIGHT cause the issue is the fact that you're not pulling the repo prior to using the action, I believe it should work without pulling the repo AFAIK but I am not 💯
Here are the outputs with the ACTIONS_STEP_DEBUG secret set to true:
##[debug]Here are the files I am changing: [
##[debug] {
##[debug] "sha": "cd183c8c3a39afb73373ff04354e2fc7505d486e",
##[debug] "filename": "posts/post-01 copy 60.md",
##[debug] "status": "renamed",
##[debug] "additions": 0,
##[debug] "deletions": 0,
##[debug] "changes": 0,
##[debug] "blob_url": "https://github.com/bukharim96/blogg-template/blob/ff29474d83a87ea102a3433c4c5cbd6dfb836f0c/posts/post-01%20copy%2060.md",
##[debug] "raw_url": "https://github.com/bukharim96/blogg-template/raw/ff29474d83a87ea102a3433c4c5cbd6dfb836f0c/posts/post-01%20copy%2060.md",
##[debug] "contents_url": "https://api.github.com/repos/bukharim96/blogg-template/contents/posts/post-01%20copy%2060.md?ref=ff29474d83a87ea102a3433c4c5cbd6dfb836f0c",
##[debug] "previous_filename": "posts/post-01 copy 67.md"
##[debug] }
##[debug]]
##[error]There was an issue sorting changed files from Github.
Exception: {
"error": "500/TypeError",
"from": "sortChangedFiles",
"message": "There was an issue sorting files changed.",
"payload": "{}"
}
(node:2485) UnhandledPromiseRejectionWarning: Error: {"error":"500/TypeError","from":"sortChangedFiles","message":"There was an issue sorting files changed.","payload":"{}"}
at run (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:19989)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2485) 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:2485) [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 trilom/file-changes-action@v1.2.3
The action fails on file rename. BTW, I'm pushing the changes not pulling them.
I see the issue- thanks for the feedback, I’ll tag this issue when it’s resolved.
Looks like exception is thrown here: https://github.com/trilom/file-changes-action/blob/a6ac0c3c43b7f68b8bde51c901439c367a7f280f/src/FilesHelper.ts#L24,
when there's an attempt to modify changedFiles.renamed
(which isn't present now).
I've searched github api and here: https://developer.github.com/v3/repos/commits/#compare-two-commits I've found this: «This includes the status of the change (for example, if a file was added, removed, modified, or renamed)».
Usually I do not use ts, but I'll try to make a PR tomorrow (because my organization need it badly :)
P.S. Anyway, I can merge it in fork and use action from there.
This is being merged in #99
Thank you everyone for doing my work for me.
I love explaining to my 9 year old how I make a thing for me, and I put it out there in the world and people go "great! It's 90% of what I need and I just need to fix/add this one little thing.".
Nice! OSS is just great.
The following error appears when files are renamed:
Setup looks like this:
Is there a recommended way to get renamed files? (BTW, cool action)