-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support List,CSV type for registry input #87
Labels
Comments
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 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 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);
} |
Up, would also like this feature. Have to login to multiple registries with the same credentials. |
@tpolekhin @iamludal @antonioua, @kscharm, @fmeriaux, @Flydiverny, @kpocius, @patrickbeekman I just released this feature here: Multi Registry Authenticator (MRA) I'd love to have your opinion on it and if there's something missing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Opening 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:
Credentials are the same for all regions, it's just the address of the registry that differs.
Could we possibly support something like this?
The text was updated successfully, but these errors were encountered: