#Use Go GitHub Action in other Repositories

6 messages · Page 1 of 1 (latest)

cold pendant
#

I created a Go Github Action which works fine in the action's repository. I want to publish this Action to the GitHub Actions marketplace and use it in my personal profile repository. However, using the action in my profile repo results in an error:

Run NickRTR/[email protected]
Run go run ./
go: cannot find main module, but found .git/config in /home/runner/work/NickRTR/NickRTR
    to create a module there, run:
    go mod init
Error: Process completed with exit code 1.

Obviously, the error is because the action tries to run in the profile repository's files. Now my question to you Gophers is: How do I fix this?

Action Repository: https://github.com/NickRTR/WakaTime-Readme

GitHub

Go GitHub Action that adds Coding time statistics to your README - GitHub - NickRTR/WakaTime-Readme: Go GitHub Action that adds Coding time statistics to your README

cold pendant
#

Please help 🤧

static ether
#

If it works in one situation then it's unlikely to be a go issue, you may get help but you'd probably have better results looking in a github dedicated chat

elfin oracle
#

it looks like you have hardcoded the repo path

#

if I'm not mistaken, you can use ${{ github.event.repository.name }} & ${{ github.event.repository.owner }} for the parameters