Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ENOENT: no such file or directory #6

Open
KilianKae opened this issue Aug 16, 2022 · 7 comments
Open

Error: ENOENT: no such file or directory #6

KilianKae opened this issue Aug 16, 2022 · 7 comments

Comments

@KilianKae
Copy link

First of all, thank you for maintaining this repo!
We have the following issue:
We receive this error:
Error: ENOENT: no such file or directory, open 'blog/test.md'

Screen Shot 2022-08-16 at 14 35 32

With this yaml:

name: publish-to-medium
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - id: files
        uses: jitterbit/get-changed-files@v1
      - id: posts
        name: Detecting posts from the changes
        run: |
          i=0
          for changed_file in ${{ steps.files.outputs.added_modified }}; do
            echo "Do something with ${changed_file}."
            if [[ "${changed_file}" == "blog/"* ]];
            then
              echo "File ${changed_file} matched post."
              echo "::set-output name=post${i}::${changed_file}"
              ((i=i+1))
            fi
          done
      - if: steps.posts.outputs.post0
        name: Publish to medium
        uses: infraway/[email protected]
        with:
          app_id: ${{ secrets.MEDIUM_APP_ID }}
          app_secret: ${{ secrets.MEDIUM_APP_SECRET }}
          access_token: ${{ secrets.MEDIUM_ACCESS_TOKEN }}
          markdown_file: ${{ steps.posts.outputs.post0 }}
          base_url: https://medium.com/@morphysm

Any ideas?

@maZahaca
Copy link
Member

@KilianKae Thanks for raising the issue and sorry for the delayed response 🙌
Could you please provide the file structure for your project?
Action assumes that you have the blog/test.md file in the repo.

@maZahaca maZahaca pinned this issue Nov 24, 2022
@maZahaca maZahaca unpinned this issue Nov 24, 2022
@AIGirl10
Copy link

@maZahaca

I am getting similar error.

Warning: Unexpected input(s) 'markdown', valid inputs are ['app_id', 'app_secret', 'access_token', 'markdown_file', 'base_url', 'post_url', 'post_status', 'post_license']
Run infraway/[email protected]
  with:
    post_status: draft
    post_license: all-rights-reserved
Error: ENOENT: no such file or directory, open ''
  • This is my workflow
name: First Post
on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Read the post
        id: post
        run: echo "::set-output name=data::$(cat ./content/post.md)"
      - uses: infraway/[email protected]
        with:
          access_token: ${{ secrets.MEDIUM_ACCESS_TOKEN }}
          markdown: ${{ steps.post.outputs.data }}
          base_url: https://medium.com/@Inconspicuous10

Thanks for your help in advance :)

@SecTestAnnaQuinn
Copy link

I hate to add to the issue, but I can confirm I am having the same issues when pushing from git bash. It is looking for the markdown file that definitely exists in the location. I will not post my debugging information as it is a duplicate of the above, with only the directory and base url changed.

@maZahaca
Copy link
Member

Thanks for reporting @AIGirl10!

I apologize, it was a mistake in the readme file, now it's updated.
You need to use markdown_file instead of markdown.

@maZahaca
Copy link
Member

maZahaca commented Jan 14, 2023

Thanks for reporting @SecTestAnnaQuinn!

Could you please share your GitHub workflow config please?
Also, could you execute the tree command in the root of the project and share related output please?

@SecTestAnnaQuinn
Copy link

I was being dumb. This is my first experiment with github workflows. After some investigations with tree (thank you for that), I discovered there were no files present in my runner's directory. After a few hours of troubleshooting to copy over the files, I discovered that it was because I wasn't using checkout. Your action worked perfectly after, I am just inexperienced with this.

Thank you for the help and the action!

@rnag
Copy link

rnag commented Jan 30, 2024

Still, the documentation at the least on github actions should be updated on usage. If the docs are wrong, then it doesn't matter if the user of an app is "dumb" - no offense @SecTestAnnaQuinn.

Simply put, missing docs that don't mention to add a checkout step is the issue. That's all. Docs need to be fixed.

FYI, I ran into this exact same issue today Error: ENOENT: no such file or directory, and to be blunt I don't appreciate my time being wasted. Even if it is 15 minutes or less, that's still too much time to waste on a GH action that doesn't work (or has incorrect or misleading docs).

Literally the only step missing from the docs is:

- name: Checkout
  uses: actions/checkout@v3

It doesn't seem too hard to update the docs to add that in there. My two cents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants