ci: expose all ACTIONS_* vars

When using `docker buildx build` in conjunction with the `gha` backend
cache type, it's important to specify the URL and TOKEN needed to
authenticate.

On Cirrus runners this is working with only `ACTIONS_CACHE_URL` and
`ACTIONS_RUNTIME_TOKEN`, but this is not enough for the GitHub backend.

Fix this by exporting all `ACTIONS_*` variables.

This fixes cache restore/save on forks or where GH-hosted runners are
being used.
This commit is contained in:
willcl-ark 2025-09-30 11:00:26 +01:00 committed by will
parent 25212dfdb4
commit bc706955d7
No known key found for this signature in database
GPG Key ID: CE6EC49945C17EA6
1 changed files with 6 additions and 2 deletions

View File

@ -22,8 +22,12 @@ runs:
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
script: | script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) Object.keys(process.env).forEach(function (key) {
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN']) if (key.startsWith('ACTIONS_')) {
core.info(`Exporting ${key}`);
core.exportVariable(key, process.env[key]);
}
});
- name: Construct docker build cache args - name: Construct docker build cache args
shell: bash shell: bash