trilom / file-changes-action

This action can be added, and you will get outputs of all of the files that have changed in your repository for you to use.
MIT License
167 stars 48 forks source link

Error: There was an issue writing output files #132

Closed john-jerome closed 2 years ago

john-jerome commented 2 years ago

Describe the bug I'm getting the following error when running this action using a self-hosted EC2 runner:

Error: There was an issue writing output files.
Exception: {
  "error": "500/Error",
  "from": "writeFiles",
  "message": "There was an issue writing output files.",
  "payload": "{\"errno\":-2,\"syscall\":\"open\",\"code\":\"ENOENT\",\"path\":\"undefined/files.json\"}"
}
(node:2104) UnhandledPromiseRejectionWarning: Error: {"error":"500/Error","from":"writeFiles","message":"There was an issue writing output files.","payload":"{\"errno\":-2,\"syscall\":\"open\",\"code\":\"ENOENT\",\"path\":\"undefined/files.json\"}"}
    at run (/actions-runner/_work/_actions/trilom/file-changes-action/v1.2.4/dist/index.js:1:19989)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2104) 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:2104) [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.

Workflow

- name: Get changed files
        id: get_file_changes
        uses: trilom/file-changes-action@v1.2.4
        with:
          output: ' '

Expected behavior Here's how my GITHUB_TOKEN Permissions look like during the job setup so I'm not sure why am I having any problems with writing the output files

Screenshot 2022-02-01 at 15 17 53

Any help would be appreciated!

nileshcrptm commented 2 years ago

Hi @john-jerome , were you able to fix it ?

john-jerome commented 2 years ago

hey @nileshcrptm, yes our Data Engineer told me that the $HOME variable was not set and file-changes-action requires it, apparently:

- name: Get changed files
        env:
          HOME: "/root"
        id: get_file_changes
        uses: trilom/file-changes-action@v1.2.4
        with:
          output: ' '

I assume this is only the case when using a self-hosted runner - I was using this action before with a github runner and never experienced this issue.