add more logging
This commit is contained in:
parent
93dd6aca70
commit
cd3d61058b
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -2870,9 +2870,10 @@ async function main() {
|
||||
new_tags: core.getInput('new-tags').trim().split('\n'),
|
||||
};
|
||||
|
||||
console.log('Tagging %s:%s with new tags', input.image, input.old_tag, input);
|
||||
console.log('Tagging %s/%s:%s with new tags', input.registry, input.image, input.old_tag, input.new_tags);
|
||||
|
||||
const manifest = await get_manifest(`${input.registry}/v2/${input.image}/manifests/${input.old_tag}`);
|
||||
|
||||
const promises = input.new_tags.map((new_tag) => {
|
||||
return put_manifest(`${input.registry}/v2/${input.image}/manifests/${new_tag}`, manifest);
|
||||
});
|
||||
@ -2892,6 +2893,7 @@ async function get_manifest(url_str) {
|
||||
});
|
||||
|
||||
if (status !== 200) {
|
||||
console.error('get manifest response', { status, body });
|
||||
throw new Error('failed to fetch existing manifest');
|
||||
}
|
||||
|
||||
@ -2904,6 +2906,7 @@ async function put_manifest(url_str, manifest) {
|
||||
}, manifest);
|
||||
|
||||
if (status >= 400) {
|
||||
console.error('get manifest response', { status, body });
|
||||
throw new Error('failed to put manifest');
|
||||
}
|
||||
}
|
||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
5
index.js
5
index.js
@ -17,9 +17,10 @@ async function main() {
|
||||
new_tags: core.getInput('new-tags').trim().split('\n'),
|
||||
};
|
||||
|
||||
console.log('Tagging %s:%s with new tags', input.image, input.old_tag, input);
|
||||
console.log('Tagging %s/%s:%s with new tags', input.registry, input.image, input.old_tag, input.new_tags);
|
||||
|
||||
const manifest = await get_manifest(`${input.registry}/v2/${input.image}/manifests/${input.old_tag}`);
|
||||
|
||||
const promises = input.new_tags.map((new_tag) => {
|
||||
return put_manifest(`${input.registry}/v2/${input.image}/manifests/${new_tag}`, manifest);
|
||||
});
|
||||
@ -39,6 +40,7 @@ async function get_manifest(url_str) {
|
||||
});
|
||||
|
||||
if (status !== 200) {
|
||||
console.error('get manifest response', { status, body });
|
||||
throw new Error('failed to fetch existing manifest');
|
||||
}
|
||||
|
||||
@ -51,6 +53,7 @@ async function put_manifest(url_str, manifest) {
|
||||
}, manifest);
|
||||
|
||||
if (status >= 400) {
|
||||
console.error('get manifest response', { status, body });
|
||||
throw new Error('failed to put manifest');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user