GeezerVison is showing github.com — Support List,CSV type for registry input · Issue #87 · docker/login-action
Support List,CSV type for registry input #87DescriptionOpening new issue to keep track of the implementation because original issue was closed #72
Right now we're using this action to login to IBM Cloud Container Registry in different regions:
- name: Login to IBM Cloud Container Registry US
uses: docker/login-action@v1
with:
registry: us.icr.io
username: ${{ env.ICR_USERNAME }}
password: ${{ env.ICR_PASSWORD }}
- name: Login to IBM Cloud Container Registry UK
uses: docker/login-action@v1
with:
registry: uk.icr.io
username: ${{ env.ICR_USERNAME }}
password: ${{ env.ICR_PASSWORD }}
Credentials are the same for all regions, it's just the address of the registry that differs.
Could we possibly support something like this?
- name: Login to IBM Cloud Container Registry ALL
uses: docker/login-action@v1
with:
registry: |
us.icr.io
uk.icr.io
de.icr.io
au.icr.io
jp.icr.io
username: ${{ env.ICR_USERNAME }}
password: ${{ env.ICR_PASSWORD }}
Reacted by Anton Kuznietsov, Kenny Scharm, Florian Meriaux, Markus Maga, Karolis Pocius, Patrick Beekman, Abu, David Pooley and ArunKumarT1995 Activityumarcor commented on Nov 21, 2021 FWIW:
env:
ICR_DOMAINS: us uk de au jp
...
uses: ./with-post-step
with:
main: |
for domain in ${{ env.ICR_DOMAINS}}; do
echo '${{ env.ICR_PASSWORD }}' | docker login "$domain".icr.io -u '${{ env.ICR_USERNAME }}' --password-stdin
done
post: for domain in ${{ env.ICR_DOMAINS}}; do docker logout "$domain"; done
where with-post-step/action.yml:
name: With post step
description: 'Generic JS Action to execute a main command and set a command in a post step.'
inputs:
main:
description: 'Main command/script.'
required: true
post:
description: 'Post command/script.'
required: true
key:
description: 'Name of the state variable used to detect the post step.'
required: false
default: POST
runs:
using: 'node12'
main: 'main.js'
post: 'main.js'
and with-post-step/main.js:
const { exec } = require('child_process');
function run(cmd) {
exec(cmd, (error, stdout, stderr) => {
if ( stdout.length != 0 ) { console.log(`${stdout}`); }
if ( stderr.length != 0 ) { console.error(`${stderr}`); }
if (error) {
process.exitCode = error.code;
console.error(`${error}`);
}
});
}
const key = process.env.INPUT_KEY.toUpperCase();
if ( process.env[`STATE_${key}`] != undefined ) { // Are we in the 'post' step?
run(process.env.INPUT_POST);
} else { // Otherwise, this is the main step
console.log(`::save-state name=${key}::true`);
run(process.env.INPUT_MAIN);
}iamludal commented on Mar 8, 2023 Up, would also like this feature. Have to login to multiple registries with the same credentials. Reacted by Abu and Rohit Thomas umarcor commented on Mar 8, 2023 Abdullah-Schahin commented on May 20, 2024 mike-pt commented on Feb 11, 2025 ArunKumarT1995 commented on Aug 1, 2025 Any updates on this ? I would like have this feature too +1. ArunKumarT1995 commented on Aug 4, 2025 I have created #877 for multi registry login. Can any maintainers review ?
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|