Skip to content

Commit bc70695

Browse files
committed
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.
1 parent 25212df commit bc70695

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/actions/configure-docker/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ runs:
2222
uses: actions/github-script@v6
2323
with:
2424
script: |
25-
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
26-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN'])
25+
Object.keys(process.env).forEach(function (key) {
26+
if (key.startsWith('ACTIONS_')) {
27+
core.info(`Exporting ${key}`);
28+
core.exportVariable(key, process.env[key]);
29+
}
30+
});
2731
2832
- name: Construct docker build cache args
2933
shell: bash

0 commit comments

Comments
 (0)