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

.github/workflow files are ignored by default #66

Open
Snailedlt opened this issue Jan 11, 2023 · 13 comments
Open

.github/workflow files are ignored by default #66

Snailedlt opened this issue Jan 11, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@Snailedlt
Copy link

At the moment my workflow file is being ignored:
image

This shouldn't happen because GitHub still says No newline at end of file for that file, so it makes no sense to ignore it by default.
image

@Logerfo
Copy link
Owner

Logerfo commented Jan 11, 2023

Interesting... I'd say this is a bug. There's no specified behavior for skipping other than the assigned paths to ignore. If no assignment is made, the default configuration ignores bin/**, node_modules/** and out/**, none of which should ignore any workflow file. I don't know if the actual behavior is related to the fact that the skipped file is the running workflow file itself.

@Logerfo Logerfo added the bug Something isn't working label Jan 11, 2023
@Snailedlt
Copy link
Author

Hmm, I first thought it might be a permission problem, but then the is ignored message seems weird, cause that only happens if the if statement above it is true.

Definitely a bug I'd say. I'm soon updating another workflow file, so I'll let you know how that goes :)

@Logerfo
Copy link
Owner

Logerfo commented Jan 11, 2023

@Snailedlt is it possible that your token has no read permission for the workflow file, but has for some other files? I don't know if that depth of granularity is supported, but perhaps you'd know if you use it.

@Snailedlt
Copy link
Author

I don't think that could even be the cause of the issue, could it?

As far as I can tell that wouldn't affect this if statement, which is what is ran to return that message you see in the first image in the issue description.

newline-action/src/main.js

Lines 114 to 117 in d5cb021

if (!paths.includes(`${REPO_DIRECTORY}/${element.filename}`)) {
core.info(`${element.filename} is ignored. Skipping...`);
continue;
}

@Logerfo
Copy link
Owner

Logerfo commented Jan 11, 2023

@Snailedlt if the blob object is unaware of the existence of the workflow file, I think that might cause the problem you stumbled upon.

@Snailedlt
Copy link
Author

I confirmed that it's at least inside .github and .github/workflow folders. Could be permission like you say, any idea how to fix it?
image

@Snailedlt Snailedlt changed the title Don't ignore .github/workflow files .github/workflow files are being ignored by default Jan 11, 2023
@Snailedlt Snailedlt changed the title .github/workflow files are being ignored by default .github/workflow files are ignored by default Jan 11, 2023
@Logerfo
Copy link
Owner

Logerfo commented Jan 11, 2023

@Snailedlt can you confirm that the action is successfully reading files located in directories other than root?

@Snailedlt
Copy link
Author

Not at the moment because we have to focus on other issues. But once I get around to doing it, I'll let you know :)

@Snailedlt
Copy link
Author

@Logerfo
image

So I guess I need to use a different github token then

@Logerfo
Copy link
Owner

Logerfo commented Jan 16, 2023

@Snailedlt I was wondering if the implemented blob was wrong, maybe only reading the root folder, but it's working fine for me: https://github.com/Logerfo/newline-test/actions/runs/3932390852/jobs/6724891213. Maybe it really is something related to permissions, specially if your repo is in an organization, but I don't know much about GitHub's granularity.

@Snailedlt
Copy link
Author

Yes, that's beginning to look more and more likely. The project is in a private repo in an organization

@pablogamboa
Copy link

I'm getting the same issue, the project is a private repo in an organization and it skips the files

@connorjchen
Copy link

connorjchen commented Apr 19, 2023

I am getting same issue as well - project is also in private repo in an organization and it is ignored

My files that are being ignored are .github/** as well as .gitignore and .dockerfile in any directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants