PaulHatch / semantic-version

A GitHub Action to generate semantic version from a git repository's commit history.
MIT License
347 stars 63 forks source link

Doesn't work in self-hosted runners #124

Closed jaimehrubiks closed 9 months ago

jaimehrubiks commented 1 year ago

This issue is a little bit odd, but using regular ubuntu-latest runner, it works perfectly. However, using self-hosted runners I can't get it to work.

Settings:

    - name: Checkout Directory
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - uses: paulhatch/semantic-version@v5.3.0
      id: version
      with:
        debug: true
        bump_each_commit: true

Expected output (github runners):

Warning: No tags are present for this repository. If this is unexpected, check to ensure that tags have been pulled from the remote.
Version is 0.0.152
To create a release for this version, go to https://<redacted>/releases/new?tag=v0.0.152&target=12a7ace5905ff4d726d45ebc028b93ac409fa069

Results obtained:

Run paulhatch/semantic-version@v5.2.0
Run '/home/runner/k8s/index.js'
No changes detected for this commit
Version is 0.0.0
To create a release for this version, go to https:/<redacted>/releases/new?tag=v0.0.0&target=

I tried multiple Docker images for the self-hosted runners, my own ones created from scratch, and others like https://hub.docker.com/r/summerwind/actions-runner/tags

I verified that the "git" version on both github runners and self-hosted is the same (git version 2.42.0), and I can verify with "git log" that "Checkout@v4" is correctly showing the whole commit history.

Any hints? Not sure what else I could check.

PaulHatch commented 1 year ago

Hey @jaimehrubiks, I am not sure which distribution your self-hosted runner is using, but I know there are issues on Alpine for example which I haven't yet addressed. Right now I am only using officially supported runner images, as setting up a runner image is a small project by itself and without an official standard image to test there's no guarantee it would be compatible anyway.

There is a diagnostic mode which produces a log of all the commands run by the action and what the results were. You can share this here if you like (watch out not to share emails you don't want public) or simply comparing the two yourself may give you insight.

I haven't yet run this action on a self hosted runner myself so any findings here would be of interest if you could share them.

jaimehrubiks commented 1 year ago

I'll do more tests soon, will keep you posted!

rune-braathen commented 9 months ago

Experienced this in our actions-runner-controller private runners on k8s, running ghcr.io/actions/actions-runner:latest

Made a workaround by

Seems to have done the trick.

jaimehrubiks commented 9 months ago

Sorry, I forgot about this and had a couple of very simple actions running on GitHub hosted runners just for this purpose. Thanks for the trick @rune-braathen

PaulHatch commented 9 months ago

Thanks @rune-braathen