Schneegans / dynamic-badges-action

This action allows you to create badges for your README.md with shields.io which may change with every commit. To do this, this action does not need to push anything to your repository!
https://schneegans.github.io/tutorials/2022/04/18/badges
MIT License
257 stars 37 forks source link

Cannot setup job on self hosted runner #31

Closed LucBerge closed 1 year ago

LucBerge commented 1 year ago

Hello,

I am having an issue using the action on a self-hosted runner. The job has not even started it fails at the Set up job step:

Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'schneegans/dynamic-badges-action@e9a478b16159b4d31420099ba146cdc50f134483' (SHA:e9a478b16159b4d31420099ba146cdc50f134483)
Error: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter ''using: node20' is not supported, use 'docker', 'node12' or 'node16' instead.')
   at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Fail to load schneegans\dynamic-badges-action\e9a478b16159b4d31420099ba146cdc50f134483\action.yml

I have node18 installed.

@Schneegans Did you try to run the action on a self-hosted runner? If yes, what node version?

LucBerge commented 1 year ago

I am trying to verify #14, I am behind a proxy

Schneegans commented 1 year ago

Well, the node version was bumped as part of #25. I think there is no requirement to use node 20 (except for that GitHub recommends it). I just pushed a branch test/node16 which uses the older node version. Do you want to test this instead? Like this: uses: schneegans/dynamic-badges-action@test/node16.

LucBerge commented 1 year ago

Do you want to test this instead? Like this: uses: schneegans/dynamic-badges-action@test/node16. I will try.

Can you run your action (master branch) on a self hosted runner to see what you have?

Schneegans commented 1 year ago

Yeah, I can test this later today!

LucBerge commented 1 year ago

For some reasons, it is working with branch test/node16. But in order to make it compatible, you must:


The problem with this line (action.yml) https://github.com/Schneegans/dynamic-badges-action/blob/e9a478b16159b4d31420099ba146cdc50f134483/action.yml#L82 is that you force your action to run with node20 only. Current self-hosted runners use node16. So when my runner set up the job, it fails because your action force to use node20. I cannot install node20 using the setup-node action because it fails before.

LucBerge commented 1 year ago

@Schneegans I think, if you want to make your action compatible with enterprise and/or self-hosted runners, you must downgrade to node16 because this is the latest supported node version for github runners.

Looks like most of the actions uses node16. Maybe for self-hosted runner compatibility!?

https://github.com/marketplace?category=&query=&type=actions&verification=
https://github.com/search?q=%22using%3A+node%22+path%3A**%2Faction.yml&type=code
LucBerge commented 1 year ago

Regarding this post, Github is moving from node16 to node20 and And self-hosted runners are at version 2.311.0 but not for companies.


What happened

The current version of my Github Enterprise is 3.10.2. In this version, when I want to setup a runner, It ask me to install runner version 2.304.0 from my company source. I guess this is a special runner compatible with my company only. Your action runs on node20 which is not compatible with the current enterprise runner I have.