Action cannot be used with Self hosted runner
See original GitHub issueIntro
Type of issue: Bug report
Reproduce
- On a clean linux machine (I tested on Ubuntu20.04, Ubuntu18.04 and Debian10).
- Following the instruction in https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service, to create a self-hosted runner
- Registrate it to your GitHub Account’s runner
- Create a sample repo which has access to that self-hosted runner
- Create a GitHub config file
jobs:
gotest:
name: GoTest
runs-on: [self-hosted, linux]
steps:
- uses: AutoModality/action-clean@v1
- name: Checkout
- uses: actions/setup-go@v2
with:
go-version: '1.14.*'
- name: Go Env
run: |
go env
- Get this error in
actions/setup-go@v2
, but it won’t exit the pipeline.
(node:12435) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: a path argument must be provided
at Object.<anonymous> (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4752:18)
at Generator.next (<anonymous>)
at /github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4692:71
at new Promise (<anonymous>)
at module.exports.672.__awaiter (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4688:12)
at Object.mkdirP (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4751:12)
at Object.<anonymous> (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:204:22)
at Generator.next (<anonymous>)
at /github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:57:71
at new Promise (<anonymous>)
- This is a non stopping error, so in
go env
line, another error will occur.
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
- Check the
go env
and you can find thatGOPATH
,GOENV
are missing.
Possible bugs
- As the
$HOME
is not correctly exported andGOCACHE
is"off"
,go
cannot run. - Besides, another possible problem may be in this part and thus get a
a path argument must be provided
error. https://github.com/actions/setup-go/blob/3b4dc6cbed1779f759b9c638cb83696acea809d1/src/main.ts#L67-L73
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:19 (2 by maintainers)
Top Results From Across the Web
Github Actions self hosted runner - YouTube
docs: https://docs.github.com/en/ actions /hosting-your-own- runners /about- self - hosted -runnersFollow me ... Your browser can't play this video.
Read more >GitHub Actions: secure self-hosted runners by limiting them to ...
You can now enforce consistent usage of self-hosted runner groups across your organization and enterprise.
Read more >GitHub self-hosted runners - Apache Software Foundation
This uses the self-hosted runners for pushes, scheduled builds, and PRs from a repo owner or contributor, but not normal public runners for...
Read more >Can GitHub Actions self hosted runners be used without a ...
There is nothing in that article that implies anything about self-hosted runners being sandboxed from an internal network perspective.
Read more >Create your Self-Hosted Github Action Runner in 5 minutes
When using Github's default runner, you will get a new VM for each workflow execution, however if you use your own self-hosted runner,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Understood and agreed - however I meant creating a folder elsewhere, even in tmp, and setting GOPATH and GOCACHE there? At a minimum, this limitation and the workaround with setting the GO values yourself should be documented in the README. What do you think?
I believe the reason of issue is missing $HOME variable on the self-hosted runners. Issue is closed because we cannot resolve it from
setup-go
action side. Please, contact us if you have any questions.