Skip to content

feat: allow passing custom ACTIONS_CACHE_URL - #1695

Closed
LouisHaftmann wants to merge 1 commit into
actions:mainfrom
LouisHaftmann:custom-actions-cache-url
Closed

LouisHaftmann wants to merge 1 commit into
actions:mainfrom
LouisHaftmann:custom-actions-cache-url

Conversation

@LouisHaftmann

@LouisHaftmann LouisHaftmann commented Mar 26, 2024 •

Copy link
Copy Markdown

Closes #1051

Currently it is not possible to overwrite the ACTIONS_CACHE_URL which is used for communicating with the cache api. The ACTIONS_CACHE_URL is always overwritten by the runner itself (runner code snippet).

Being able to overwrite this environment variable is crucial for using the actions/cache action with self-hosted runners, as it allows for a self-hosted caching solution.

To set a custom ACTIONS_CACHE_URL, you just need to define the CUSTOM_ACTIONS_CACHE_URL (open for naming suggestions) env var, which takes precedence over the default cache url env var.

Self-hosting an actions cache server is a much requested feature and this PR would make that way easier

Other issues/discussions:

@LouisHaftmann
LouisHaftmann requested a review from a team as a code owner March 26, 2024 16:34
@edigaryev

Copy link
Copy Markdown

@robherley, @bethanyj28 would you mind taking a look at this?

@LouisHaftmann

Copy link
Copy Markdown
Author

Any feedback on this PR? Is there something I should implement differently or something missing? I will gladly do anything to get this PR merged.

@LouisHaftmann

Copy link
Copy Markdown
Author

Here are some more PRs mentioning the same issue:
#947
#679

Would be great to have this feature! I don't see any real problem or security risk with this. Am I missing something? Would there be a safer way to allow for overwriting the cache server url?

Please let me know 🙏 @robherley @bethanyj28

@fingerart

Copy link
Copy Markdown

@robherley @bethanyj28

@breezewish

Copy link
Copy Markdown

Would be great to have this option! It is hard to overwrite the cache url in self-hosted runners currently.

@fkorotkov

Copy link
Copy Markdown

In the meantime we created a simple fork that patches compiled JavaScript in dist folder of actions/cache to allow overriding ACTIONS_CACHE_URL.

See here how to run it with your own implementation of the Caching API.

@Tycale

Tycale commented Jul 18, 2024

Copy link
Copy Markdown

Patching the binary also works, but it’s frustrating not to be able to do it correctly. It's such a small patch..

@LouisHaftmann

Copy link
Copy Markdown
Author

I'm beginning to feel like only Github staff contributions are welcome in this repo 🥲

@Tycale

Tycale commented Jul 18, 2024

Copy link
Copy Markdown

I tried contacting a staff member via email to review this PR. Fingers crossed! 🤞🏻

enescakir added a commit to enescakir/runner that referenced this pull request Jul 31, 2024
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. The need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value is their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, myself included.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
enescakir added a commit to enescakir/runner that referenced this pull request Jul 31, 2024
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
@enescakir

Copy link
Copy Markdown

I've submitted a PR to introduce a similar feature into the runner script. I hope one of them merges. actions/runner#3411

@enescakir

Copy link
Copy Markdown

Hi @Link- , Enabling the overwriting the ACTIONS_CACHE_URL variable would simplify things for the community. What do you think about this PR?

@Link-

Link- commented Nov 29, 2024

Copy link
Copy Markdown
Member

Hi @Link- , Enabling the overwriting the ACTIONS_CACHE_URL variable would simplify things for the community. What do you think about this PR?

I do not believe we have plans to support this path at the moment. We're introducing major changes and optimisations to the cache service which will be landing soon.

cc: @lkfortuna

@Link- Link- closed this Nov 29, 2024
enescakir added a commit to enescakir/runner that referenced this pull request Dec 4, 2024
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
@tetienne

Copy link
Copy Markdown

Hi @Link- Can we have visibility on your plan, anyplace where can see progress?

dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jun 11, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jul 21, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jul 24, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jul 25, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jul 25, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Aug 14, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Oct 17, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Dec 15, 2025
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jan 22, 2026
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Mar 19, 2026
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Jun 1, 2026
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
OliverHenrichs pushed a commit to vizlib/github-runner that referenced this pull request Sep 28, 2026
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
OliverHenrichs pushed a commit to vizlib/github-runner that referenced this pull request Oct 27, 2026
The runner script sets the `ACTIONS_CACHE_URL` using the value from the
system connection. Currently, there's no way to override it.

Some community users use custom cache solutions with self-hosted
runners. They need to maintain a fork of `actions/runner` or
`actions/toolkit`, and `actions/cache` to override the value in their
solution. However it leads to significant maintenance work.

If the runner script allows the `ACTIONS_CACHE_URL` value to be
overridden by the `CUSTOM_ACTIONS_CACHE_URL` environment variable, it
makes life a lot easier for the community, includes myself.

An alternative solution could involve allowing the base URL value in
`actions/toolkit` to be overridden. Several individuals have submitted
similar PRs to this one actions/toolkit#1695,
but they have not received adequate attention from the maintainers.
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.

Add support for non-GitHub-hosted caching for self-hosted runners

9 participants