Skip to content

Commit

Permalink
Add registry URLs as output to the start-proxy Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael B. Gale committed Dec 13, 2024
1 parent dd75594 commit 62192f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/start-proxy-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/start-proxy-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/start-proxy-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ async function startProxy(
core.setOutput("proxy_host", host);
core.setOutput("proxy_port", port.toString());
core.setOutput("proxy_ca_certificate", config.ca.cert);

const registry_urls = config.all_credentials
.filter((credential) => credential.url !== undefined)
.map((credential) => credential.url);
core.setOutput("proxy_urls", JSON.stringify(registry_urls));
} catch (error) {
core.setFailed(`start-proxy action failed: ${util.getErrorMessage(error)}`);
}
Expand Down
2 changes: 2 additions & 0 deletions start-proxy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ outputs:
description: The port of the proxy
proxy_ca_certificate:
description: The proxy's internal CA certificate in PEM format
proxy_urls:
description: The URLs of the configured registries, as a JSON array.
runs:
using: node20
main: "../lib/start-proxy-action.js"
Expand Down

0 comments on commit 62192f8

Please sign in to comment.