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

Fails to run on self-hosted Github action runner? #81

Open
Nedlinin opened this issue May 12, 2020 · 4 comments
Open

Fails to run on self-hosted Github action runner? #81

Nedlinin opened this issue May 12, 2020 · 4 comments

Comments

@Nedlinin
Copy link

This is failing to run on my selfhosted Linux Github action runner.

2020-05-12T00:54:49.6255155Z   routes/settings.js:10:27
2020-05-12T00:54:49.6256163Z   ✖   10:27   Please rename the variable res. Suggested names are: response, result. A more descriptive name will do too.                                                                 unicorn/prevent-abbreviations
2020-05-12T00:54:49.6256276Z 
2020-05-12T00:54:49.6256422Z   1 errors
2020-05-12T00:54:49.6256495Z 
2020-05-12T00:54:49.6256890Z 
2020-05-12T00:54:49.6257150Z Oops! Something went wrong! :(
2020-05-12T00:54:49.6257254Z 
2020-05-12T00:54:49.6257426Z ESLint: 7.0.0
2020-05-12T00:54:49.6257517Z 
2020-05-12T00:54:49.6258085Z Error: Command failed with exit code 128: git rev-parse HEAD^1
2020-05-12T00:54:49.6258697Z fatal: ambiguous argument 'HEAD^1': unknown revision or path not in the working tree.
2020-05-12T00:54:49.6259213Z Use '--' to separate paths from revisions, like this:
2020-05-12T00:54:49.6259686Z 'git <command> [<revision>...] -- [<file>...]'
2020-05-12T00:54:49.6259856Z HEAD^1
2020-05-12T00:54:49.6260132Z     at makeError (/home/runner/_work/timesheet/timesheet/node_modules/execa/lib/error.js:58:11)
2020-05-12T00:54:49.6260438Z     at handlePromise (/home/runner/_work/timesheet/timesheet/node_modules/execa/index.js:114:26)
2020-05-12T00:54:49.6260685Z     at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-05-12T00:54:49.6504410Z npm ERR! code ELIFECYCLE
2020-05-12T00:54:49.6505272Z npm ERR! errno 2
2020-05-12T00:54:49.6514823Z npm ERR! [email protected] lint:ci: `eslint --format github .`
2020-05-12T00:54:49.6515081Z npm ERR! Exit status 2
2020-05-12T00:54:49.6515243Z npm ERR! 
2020-05-12T00:54:49.6516012Z npm ERR! Failed at the [email protected] lint:ci script.
2020-05-12T00:54:49.6516462Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-05-12T00:54:49.6946007Z 
2020-05-12T00:54:49.6947026Z npm ERR! A complete log of this run can be found in:
2020-05-12T00:54:49.6948174Z npm ERR!     /root/.npm/_logs/2020-05-12T00_54_49_652Z-debug.log
2020-05-12T00:54:49.6983875Z ##[error]Process completed with exit code 2.
2020-05-12T00:54:49.7084575Z Post job cleanup.
2020-05-12T00:54:49.9640317Z [command]/usr/bin/git version
2020-05-12T00:54:49.9803430Z git version 2.20.1
2020-05-12T00:54:49.9932527Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2020-05-12T00:54:50.0045392Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2020-05-12T00:54:50.0706051Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-05-12T00:54:50.0789504Z http.https://github.com/.extraheader
2020-05-12T00:54:50.0819524Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2020-05-12T00:54:50.0930479Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2020-05-12T00:54:50.1770095Z Cleaning up orphan processes
@hipstersmoothie
Copy link
Owner

Has it ever worked in your action runner before?

@hipstersmoothie
Copy link
Owner

Does your repo have more than 1 commit?
Is it a shallow clone? This formatter requires at least 2 commits in the history right now. if the head commit doesn't exists we fall back to the previous commit.

https://github.com/hipstersmoothie/create-check/blob/master/src/index.ts#L110

If you want to make a PR to that repo with better fallback logic I'll accept it. Might be a few days until I can get to it

@Nedlinin
Copy link
Author

@hipstersmoothie : This is the very first time trying to run it.

I'm using

steps: - uses: actions/checkout@v2

Which appears to do a shallow clone by default. Changed it to depth 0 to enable full clone and it appears to have gotten rid of the error but no actual check annotations are applied.

@osmestad
Copy link

osmestad commented Oct 7, 2020

I'm also hitting this issue running on Jenkins, I'm not sure in which conditions the previous commit fallback is needed, but could one option be to move this line:
const PRE_HEAD = (await execa('git', ['rev-parse', 'HEAD^1'])).stdout;
into the catch-block where it is used?

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

3 participants