mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-04-20 23:31:22 +00:00
Add feature to pass extra args when pushing image
If a user wants to pass few extra args to push command when pushing image, then he can pass using 'extra-args' input parameter. Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
e7b5c08b38
commit
38bde145f1
4 changed files with 18 additions and 2 deletions
10
README.md
10
README.md
|
@ -68,7 +68,15 @@ Refer to the [`podman push`](http://docs.podman.io/en/latest/markdown/podman-man
|
|||
<td>digestfile</td>
|
||||
<td>No</td>
|
||||
<td>After copying the image, write the digest of the resulting image to the file. By default, the filename will be determined from the image and tag.
|
||||
The contents of this file are the <code>digest</code> output.
|
||||
The contents of this file are the <code>digest</code> output.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>extra-args</td>
|
||||
<td>No</td>
|
||||
<td>Extra args to be passed to push command when pushing image.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
## Action Outputs
|
||||
|
|
|
@ -31,6 +31,9 @@ inputs:
|
|||
By default, the filename will be determined from the image and tag.
|
||||
The contents of this file are the digest output.
|
||||
required: false
|
||||
extra-args:
|
||||
description: 'Extra args to be passed to push command when pushing image'
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
digest:
|
||||
|
|
|
@ -43,6 +43,7 @@ async function run(): Promise<void> {
|
|||
const password = core.getInput("password", { required: true });
|
||||
const tlsVerify = core.getInput("tls-verify");
|
||||
const digestFileInput = core.getInput("digestfile");
|
||||
const extraArgs = core.getInput("extra-args");
|
||||
|
||||
imageToPush = `${imageInput}`;
|
||||
const registryPathList: string[] = [];
|
||||
|
@ -159,6 +160,10 @@ async function run(): Promise<void> {
|
|||
registryPath,
|
||||
];
|
||||
|
||||
if (extraArgs) {
|
||||
args.push(extraArgs);
|
||||
}
|
||||
|
||||
// check if tls-verify is not set to null
|
||||
if (tlsVerify) {
|
||||
args.push(`--tls-verify=${tlsVerify}`);
|
||||
|
|
Loading…
Reference in a new issue