update inputs; readme
This commit is contained in:
24
dist/index.js
vendored
24
dist/index.js
vendored
@@ -2875,16 +2875,15 @@ async function main() {
|
||||
const input = {
|
||||
registry: core.getInput('registry'),
|
||||
registry_url: null,
|
||||
insecure_registry: core.getInput('insecure-registry') === 'true',
|
||||
image: core.getInput('image'),
|
||||
old_tag: core.getInput('old-tag'),
|
||||
new_tags: core.getInput('new-tags').trim().split('\n'),
|
||||
insecure: core.getInput('insecure') === 'true',
|
||||
username: core.getInput('username'),
|
||||
password: core.getInput('password'),
|
||||
manifest: parse_manifest_tag(core.getInput('manifest')),
|
||||
tags: parse_tags(core.getInput('tags').trim()),
|
||||
token: null,
|
||||
};
|
||||
|
||||
input.registry_url = `http${input.insecure_registry ? '' : 's'}://${input.registry}`;
|
||||
input.registry_url = `http${input.insecure ? '' : 's'}://${input.registry}`;
|
||||
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);
|
||||
@@ -2902,6 +2901,21 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
function parse_manifest_tag(full_tag) {
|
||||
const colon_index = full_tag.lastIndexOf(':');
|
||||
const image = full_tag.slice(0, colon_index);
|
||||
const tag = full_tag.slice(colon_index + 1);
|
||||
return { image, tag };
|
||||
}
|
||||
|
||||
function parse_tags(tags) {
|
||||
if (tags.indexOf('\n') < 0) {
|
||||
return tags.split(',').map((tag) => tag.trim());
|
||||
}
|
||||
|
||||
return tags.split('\n').map((tag) => tag.trim());
|
||||
}
|
||||
|
||||
async function get_manifest(input) {
|
||||
const path = `/v2/${input.image}/manifests/${input.old_tag}`;
|
||||
let { status, headers, body } = await http_req('GET', input.registry_url + path, {
|
||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user