actionlint: TestLintFindProjectFromPath test fail on v1.6.25

Running go test -v ./ ./scripts/... on v1.6.25 fails with this error:

=== RUN   TestLintFindProjectFromPath
    linter_test.go:223: no error was detected though the project was found from path parameter
--- FAIL: TestLintFindProjectFromPath (0.00s)

Although it says no error was detected, but it fails, I haven’t investigated more. Full log: https://github.com/aminvakil/aur/actions/runs/5282061811/jobs/9556494234?pr=274#step:11:1968

Tests are running every night and it was fine during the previous upgrades, you can see more in github repository as well.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I fixed the test case to work even if actionlint/.git doesn’t exist. From v1.6.26 release, you can safely remove the change in https://github.com/aminvakil/aur/pull/281.

can’t it at least look for .github folder presence?

There is no guarantee that .github directory is put in root repository only. For example, .github directory may be put in somewhere else and symlinked to root of the repository. It’s better to check both .git and .github IMO.

Merged, shouldn’t this get fixed here though? Why is .git presence necessary?

I’ll add fix in this repository as well. However, for releasing v1.6.25, the fix in your side would be necessary until the next version (probably v1.6.26) is released.

.git is necessary because TestLintFindProjectFromPath checks if actionlint can find repository root directory. actionlint finds repository root by looking at .git directory. Currently actionlint repository’s .git is used for the test. Git does not allow committing .git directory (git add testdata/.git is simply ignored) so it is tricky to prepare a fake .git directory for tests.

Please tell me if there was any problem in running CI, …

Today I could reproduce this issue in my forked repository. I’ll investigate what is happening.

https://github.com/rhysd/aur-for-actionlint-bug/actions/runs/5312477943/jobs/9617034652