Skip to content

Conversation

@ElsevierAlex
Copy link
Contributor

Fix: Allow runner name to use hostname without the github-runner- prefix to avoid exceeding GitHub's 64-character limit for runner names.

Problem Description

Currently, the runner name generation logic in [entrypoint.sh](https://github.com/myoung34/docker-github-actions-runner/blob/master/entrypoint.sh#L45) always includes a prefix when using the hostname, which can cause the total runner name to exceed GitHub's 64-character limit.
The hostname length can be controlled by the consumer to be up to 64 characters, but the prefix may cause the limit to be exceeded, resulting in the runner failing to be created with the following error:
An error occurred: Not configured. Run config.(sh/cmd) to configure the runner.

This is problematic in cases where:

  • Adding the default prefix github-runner- (14 characters) + hostname would exceed the 64-character limit
  • The current logic forces a dash separator even when RUNNER_NAME_PREFIX is empty

Copy link
Owner

@myoung34 myoung34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a breaking change.

Before: it would be github-runner-{hostname} with nothing set.
While your changes work, the after is now hostname with nothing set

If you Default RUNNER_NAME_PREFIX to github-runner I'll approve this as it means no one will need to change anything, and you can use RUNNER_NAME_PREFIX="" to get the new behavior for yourself

@ElsevierAlex ElsevierAlex force-pushed the allow-runner-name-without-prefix branch from 6503ad0 to bf1835f Compare July 14, 2025 08:24
@ElsevierAlex
Copy link
Contributor Author

This could be a breaking change.

Before: it would be github-runner-{hostname} with nothing set. While your changes work, the after is now hostname with nothing set

If you Default RUNNER_NAME_PREFIX to github-runner I'll approve this as it means no one will need to change anything, and you can use RUNNER_NAME_PREFIX="" to get the new behavior for yourself

This could be a breaking change.

Before: it would be github-runner-{hostname} with nothing set. While your changes work, the after is now hostname with nothing set

If you Default RUNNER_NAME_PREFIX to github-runner I'll approve this as it means no one will need to change anything, and you can use RUNNER_NAME_PREFIX="" to get the new behavior for yourself

Addressed

@ElsevierAlex ElsevierAlex requested a review from myoung34 July 14, 2025 08:27
@myoung34 myoung34 merged commit 176b4f8 into myoung34:master Jul 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants