mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-04-20 06:36:17 +02:00
Resolve review comments
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
73da53f4a0
commit
3b62e47486
8 changed files with 79 additions and 79 deletions
8
.github/workflows/verify-push.yaml
vendored
8
.github/workflows/verify-push.yaml
vendored
|
@ -6,7 +6,7 @@ on: [ push, workflow_dispatch ]
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: myimage
|
IMAGE_NAME: myimage
|
||||||
IMAGE_REGISTRY: quay.io
|
IMAGE_REGISTRY: quay.io
|
||||||
IMAGE_TAG: latest
|
IMAGE_TAGS: v1 ${{ github.sha }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -23,9 +23,7 @@ jobs:
|
||||||
FROM busybox
|
FROM busybox
|
||||||
RUN echo "hello world"
|
RUN echo "hello world"
|
||||||
EOF
|
EOF
|
||||||
docker tag ${{ env.IMAGE_NAME }}:v1 ${{ env.IMAGE_NAME }}:v2
|
docker tag ${{ env.IMAGE_NAME }}:v1 ${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
docker tag ${{ env.IMAGE_NAME }}:v1 ${{ env.IMAGE_NAME }}:v3
|
|
||||||
|
|
||||||
|
|
||||||
# Push the image to image registry
|
# Push the image to image registry
|
||||||
- name: Push To Quay
|
- name: Push To Quay
|
||||||
|
@ -33,7 +31,7 @@ jobs:
|
||||||
id: push
|
id: push
|
||||||
with:
|
with:
|
||||||
image: ${{ env.IMAGE_NAME }}
|
image: ${{ env.IMAGE_NAME }}
|
||||||
tags: v1 v2 v3
|
tags: ${{ env.IMAGE_TAGS }}
|
||||||
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
|
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
20
README.md
20
README.md
|
@ -31,10 +31,10 @@ Refer to the [`podman push`](http://docs.podman.io/en/latest/markdown/podman-man
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>tag</td>
|
<td>tags</td>
|
||||||
<td>No</td>
|
<td>No</td>
|
||||||
<td>
|
<td>
|
||||||
Image tag to push.<br>
|
The tag or tags of the image to push. For multiple tags, seperate by a space. For example, <code>latest {{ github.sha }}</code><br>
|
||||||
Defaults to <code>latest</code>.
|
Defaults to <code>latest</code>.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -73,12 +73,12 @@ Refer to the [`podman push`](http://docs.podman.io/en/latest/markdown/podman-man
|
||||||
|
|
||||||
## Action Outputs
|
## Action Outputs
|
||||||
|
|
||||||
`registry-paths`: The List of registry paths to which the tag(s) were pushed.<br>
|
`registry-paths`: A JSON array of registry paths to which the tag(s) were pushed.<br>
|
||||||
For example, `quay.io/username/spring-image:v1,quay.io/username/spring-image:v2`.
|
For example, `[ quay.io/username/spring-image:v1,quay.io/username/spring-image:latest ]`.
|
||||||
|
|
||||||
`digest`: The pushed image digest, as written to the `digestfile`.<br>
|
`digest`: The pushed image digest, as written to the `digestfile`.<br>
|
||||||
For example, `sha256:66ce924069ec4181725d15aa27f34afbaf082f434f448dc07a42daa3305cdab3`.
|
For example, `sha256:66ce924069ec4181725d15aa27f34afbaf082f434f448dc07a42daa3305cdab3`.
|
||||||
For multiple tags, digest remains same.
|
For multiple tags, the digest remains same.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@ -94,16 +94,18 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: my-app
|
IMAGE_NAME: my-app
|
||||||
IMAGE_TAG: latest
|
IMAGE_TAGS: latest v1
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Build Image
|
- name: Build Image
|
||||||
|
id: build-image
|
||||||
uses: redhat-actions/buildah-build@v1
|
uses: redhat-actions/buildah-build@v1
|
||||||
with:
|
with:
|
||||||
image: ${{ env.IMAGE_NAME }}
|
image: ${{ env.IMAGE_NAME }}
|
||||||
tag: ${{ env.TAG }}
|
tags: ${{ env.IMAGE_TAGS }}
|
||||||
|
base-image: some_image
|
||||||
dockerfiles: |
|
dockerfiles: |
|
||||||
./Dockerfile
|
./Dockerfile
|
||||||
|
|
||||||
|
@ -111,8 +113,8 @@ jobs:
|
||||||
id: push-to-quay
|
id: push-to-quay
|
||||||
uses: redhat-actions/push-to-registry@v1
|
uses: redhat-actions/push-to-registry@v1
|
||||||
with:
|
with:
|
||||||
image: ${{ env.IMAGE_NAME }}
|
image: ${{ steps.build-image.outputs.image }}
|
||||||
tag: ${{ env.TAG }}
|
tags: ${{ steps.build-image.outputs.tags }}
|
||||||
registry: ${{ secrets.QUAY_REPO }}
|
registry: ${{ secrets.QUAY_REPO }}
|
||||||
username: ${{ secrets.QUAY_USERNAME }}
|
username: ${{ secrets.QUAY_USERNAME }}
|
||||||
password: ${{ secrets.QUAY_TOKEN }}
|
password: ${{ secrets.QUAY_TOKEN }}
|
||||||
|
|
|
@ -9,7 +9,7 @@ inputs:
|
||||||
description: 'Name of the image to push'
|
description: 'Name of the image to push'
|
||||||
required: true
|
required: true
|
||||||
tags:
|
tags:
|
||||||
description: 'The tags of the image to push. For multiple tags, seperate by a space. For example, "v1 v0.1".'
|
description: 'The tag or tags of the image to push. For multiple tags, seperate by a space. For example, "latest v1"'
|
||||||
required: false
|
required: false
|
||||||
default: 'latest'
|
default: 'latest'
|
||||||
registry:
|
registry:
|
||||||
|
@ -34,9 +34,9 @@ inputs:
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
digest:
|
digest:
|
||||||
description: 'The pushed image digest, as written to the `digestfile`'
|
description: 'The pushed image digest, as written to the "digestfile"'
|
||||||
registry-paths:
|
registry-paths:
|
||||||
description: 'List of registry paths to which the tag(s) were pushed'
|
description: 'A JSON array of registry paths to which the tag(s) were pushed'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
98
package-lock.json
generated
98
package-lock.json
generated
|
@ -114,9 +114,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@redhat-actions/eslint-config": {
|
"@redhat-actions/eslint-config": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.11",
|
||||||
"resolved": "https://registry.npmjs.org/@redhat-actions/eslint-config/-/eslint-config-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@redhat-actions/eslint-config/-/eslint-config-1.2.11.tgz",
|
||||||
"integrity": "sha512-HFpdgXIB01wmZbCsEpaY0UhQlRBiM/kJxO0WCufIx/wTxepewwsLTsgCgKkljbGfSaqN7FMJ/TbwY1CY/ltHcw==",
|
"integrity": "sha512-hS8XXkpWu32Z3S6+EFAvD32+QruxyLiSfqrXjkaSLtWZndkJLNZ/xpHcEwRM1u7KJzd1f7jPl46+GLFfrPT8RQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"eslint-config-airbnb-base": ">= 14",
|
"eslint-config-airbnb-base": ">= 14",
|
||||||
|
@ -130,9 +130,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/json-schema": {
|
"@types/json-schema": {
|
||||||
"version": "7.0.6",
|
"version": "7.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz",
|
||||||
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
|
"integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/json5": {
|
"@types/json5": {
|
||||||
|
@ -148,13 +148,13 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@typescript-eslint/eslint-plugin": {
|
"@typescript-eslint/eslint-plugin": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.1.tgz",
|
||||||
"integrity": "sha512-IJ5e2W7uFNfg4qh9eHkHRUCbgZ8VKtGwD07kannJvM5t/GU8P8+24NX8gi3Hf5jST5oWPY8kyV1s/WtfiZ4+Ww==",
|
"integrity": "sha512-5JriGbYhtqMS1kRcZTQxndz1lKMwwEXKbwZbkUZNnp6MJX0+OVXnG0kOlBZP4LUAxEyzu3cs+EXd/97MJXsGfw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/experimental-utils": "4.14.0",
|
"@typescript-eslint/experimental-utils": "4.14.1",
|
||||||
"@typescript-eslint/scope-manager": "4.14.0",
|
"@typescript-eslint/scope-manager": "4.14.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"functional-red-black-tree": "^1.0.1",
|
"functional-red-black-tree": "^1.0.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
|
@ -164,55 +164,55 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/experimental-utils": {
|
"@typescript-eslint/experimental-utils": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.1.tgz",
|
||||||
"integrity": "sha512-6i6eAoiPlXMKRbXzvoQD5Yn9L7k9ezzGRvzC/x1V3650rUk3c3AOjQyGYyF9BDxQQDK2ElmKOZRD0CbtdkMzQQ==",
|
"integrity": "sha512-2CuHWOJwvpw0LofbyG5gvYjEyoJeSvVH2PnfUQSn0KQr4v8Dql2pr43ohmx4fdPQ/eVoTSFjTi/bsGEXl/zUUQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/json-schema": "^7.0.3",
|
"@types/json-schema": "^7.0.3",
|
||||||
"@typescript-eslint/scope-manager": "4.14.0",
|
"@typescript-eslint/scope-manager": "4.14.1",
|
||||||
"@typescript-eslint/types": "4.14.0",
|
"@typescript-eslint/types": "4.14.1",
|
||||||
"@typescript-eslint/typescript-estree": "4.14.0",
|
"@typescript-eslint/typescript-estree": "4.14.1",
|
||||||
"eslint-scope": "^5.0.0",
|
"eslint-scope": "^5.0.0",
|
||||||
"eslint-utils": "^2.0.0"
|
"eslint-utils": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/parser": {
|
"@typescript-eslint/parser": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.14.1.tgz",
|
||||||
"integrity": "sha512-sUDeuCjBU+ZF3Lzw0hphTyScmDDJ5QVkyE21pRoBo8iDl7WBtVFS+WDN3blY1CH3SBt7EmYCw6wfmJjF0l/uYg==",
|
"integrity": "sha512-mL3+gU18g9JPsHZuKMZ8Z0Ss9YP1S5xYZ7n68Z98GnPq02pYNQuRXL85b9GYhl6jpdvUc45Km7hAl71vybjUmw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/scope-manager": "4.14.0",
|
"@typescript-eslint/scope-manager": "4.14.1",
|
||||||
"@typescript-eslint/types": "4.14.0",
|
"@typescript-eslint/types": "4.14.1",
|
||||||
"@typescript-eslint/typescript-estree": "4.14.0",
|
"@typescript-eslint/typescript-estree": "4.14.1",
|
||||||
"debug": "^4.1.1"
|
"debug": "^4.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/scope-manager": {
|
"@typescript-eslint/scope-manager": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.1.tgz",
|
||||||
"integrity": "sha512-/J+LlRMdbPh4RdL4hfP1eCwHN5bAhFAGOTsvE6SxsrM/47XQiPSgF5MDgLyp/i9kbZV9Lx80DW0OpPkzL+uf8Q==",
|
"integrity": "sha512-F4bjJcSqXqHnC9JGUlnqSa3fC2YH5zTtmACS1Hk+WX/nFB0guuynVK5ev35D4XZbdKjulXBAQMyRr216kmxghw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/types": "4.14.0",
|
"@typescript-eslint/types": "4.14.1",
|
||||||
"@typescript-eslint/visitor-keys": "4.14.0"
|
"@typescript-eslint/visitor-keys": "4.14.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/types": {
|
"@typescript-eslint/types": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.1.tgz",
|
||||||
"integrity": "sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A==",
|
"integrity": "sha512-SkhzHdI/AllAgQSxXM89XwS1Tkic7csPdndUuTKabEwRcEfR8uQ/iPA3Dgio1rqsV3jtqZhY0QQni8rLswJM2w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@typescript-eslint/typescript-estree": {
|
"@typescript-eslint/typescript-estree": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.1.tgz",
|
||||||
"integrity": "sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag==",
|
"integrity": "sha512-M8+7MbzKC1PvJIA8kR2sSBnex8bsR5auatLCnVlNTJczmJgqRn8M+sAlQfkEq7M4IY3WmaNJ+LJjPVRrREVSHQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/types": "4.14.0",
|
"@typescript-eslint/types": "4.14.1",
|
||||||
"@typescript-eslint/visitor-keys": "4.14.0",
|
"@typescript-eslint/visitor-keys": "4.14.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"globby": "^11.0.1",
|
"globby": "^11.0.1",
|
||||||
"is-glob": "^4.0.1",
|
"is-glob": "^4.0.1",
|
||||||
|
@ -222,12 +222,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/visitor-keys": {
|
"@typescript-eslint/visitor-keys": {
|
||||||
"version": "4.14.0",
|
"version": "4.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.1.tgz",
|
||||||
"integrity": "sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA==",
|
"integrity": "sha512-TAblbDXOI7bd0C/9PE1G+AFo7R5uc+ty1ArDoxmrC1ah61Hn6shURKy7gLdRb1qKJmjHkqu5Oq+e4Kt0jwf1IA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/types": "4.14.0",
|
"@typescript-eslint/types": "4.14.1",
|
||||||
"eslint-visitor-keys": "^2.0.0"
|
"eslint-visitor-keys": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -917,9 +917,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flatted": {
|
"flatted": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz",
|
||||||
"integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
|
"integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"fs.realpath": {
|
"fs.realpath": {
|
||||||
|
@ -941,9 +941,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"get-intrinsic": {
|
"get-intrinsic": {
|
||||||
"version": "1.0.2",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.0.tgz",
|
||||||
"integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==",
|
"integrity": "sha512-M11rgtQp5GZMZzDL7jLTNxbDfurpzuau5uqRWDPvlHjfvg3TdScAZo96GLvhMjImrmR8uAt0FS2RLoMrfWGKlg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"function-bind": "^1.1.1",
|
"function-bind": "^1.1.1",
|
||||||
|
@ -1806,9 +1806,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tsutils": {
|
"tsutils": {
|
||||||
"version": "3.19.1",
|
"version": "3.20.0",
|
||||||
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz",
|
||||||
"integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==",
|
"integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^1.8.1"
|
"tslib": "^1.8.1"
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
"@actions/io": "^1.0.2"
|
"@actions/io": "^1.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@redhat-actions/eslint-config": "^1.2.0",
|
"@redhat-actions/eslint-config": "^1.2.11",
|
||||||
"@redhat-actions/tsconfig": "^1.1.0",
|
"@redhat-actions/tsconfig": "^1.1.0",
|
||||||
"@types/node": "^12.12.7",
|
"@types/node": "^12.12.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.14.0",
|
"@typescript-eslint/eslint-plugin": "^4.14.1",
|
||||||
"@typescript-eslint/parser": "^4.14.0",
|
"@typescript-eslint/parser": "^4.14.1",
|
||||||
"@vercel/ncc": "^0.25.1",
|
"@vercel/ncc": "^0.25.1",
|
||||||
"eslint": "^7.18.0",
|
"eslint": "^7.18.0",
|
||||||
"typescript": "^4.0.5"
|
"typescript": "^4.0.5"
|
||||||
|
|
16
src/index.ts
16
src/index.ts
|
@ -30,7 +30,7 @@ const dockerBaseUrl = "docker.io/library";
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
const imageInput = core.getInput("image", { required: true });
|
const imageInput = core.getInput("image", { required: true });
|
||||||
const tags = core.getInput("tags");
|
const tags = core.getInput("tags") || "latest";
|
||||||
// split tags
|
// split tags
|
||||||
tagsList = tags.split(" ");
|
tagsList = tags.split(" ");
|
||||||
const registry = core.getInput("registry", { required: true });
|
const registry = core.getInput("registry", { required: true });
|
||||||
|
@ -58,26 +58,26 @@ async function run(): Promise<void> {
|
||||||
const isPodmanImageLatest = await isPodmanLocalImageLatest();
|
const isPodmanImageLatest = await isPodmanLocalImageLatest();
|
||||||
if (!isPodmanImageLatest) {
|
if (!isPodmanImageLatest) {
|
||||||
core.warning(`The version of ${imageToPush} in the Docker image storage is more recent `
|
core.warning(`The version of ${imageToPush} in the Docker image storage is more recent `
|
||||||
+ `than the version in the Podman image storage. The image from the Docker image storage `
|
+ `than the version in the Podman image storage. The image(s) from the Docker image storage `
|
||||||
+ `will be pushed.`);
|
+ `will be pushed.`);
|
||||||
imageToPush = `${dockerBaseUrl}/${imageToPush}`;
|
imageToPush = `${dockerBaseUrl}/${imageToPush}`;
|
||||||
isImageFromDocker = true;
|
isImageFromDocker = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`The version of ${imageToPush} in the Podman image storage is more recent `
|
core.warning(`The version of ${imageToPush} in the Podman image storage is more recent `
|
||||||
+ `than the version in the Docker image storage. Tag(s) of the image from the Podman image `
|
+ `than the version in the Docker image storage. The image(s) from the Podman image `
|
||||||
+ `storage will be pushed.`);
|
+ `storage will be pushed.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isPresentInDocker) {
|
else if (isPresentInDocker) {
|
||||||
imageToPush = `${dockerBaseUrl}/${imageToPush}`;
|
imageToPush = `${dockerBaseUrl}/${imageToPush}`;
|
||||||
core.info(`${imageToPush} was found in the Docker image storage, but not in the Podman `
|
core.info(`${imageToPush} was found in the Docker image storage, but not in the Podman `
|
||||||
+ `image storage. Tag(s) of the image will be pulled into Podman image storage, pushed, and then `
|
+ `image storage. The image(s) will be pulled into Podman image storage, pushed, and then `
|
||||||
+ `removed from the Podman image storage.`);
|
+ `removed from the Podman image storage.`);
|
||||||
isImageFromDocker = true;
|
isImageFromDocker = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pushMsg = `Pushing ${imageToPush} with tags ${tagsList.toString()} to ${registry}`;
|
let pushMsg = `Pushing ${imageToPush} with tags ${tagsList.join(", ")} to ${registry}`;
|
||||||
if (username) {
|
if (username) {
|
||||||
pushMsg += ` as ${username}`;
|
pushMsg += ` as ${username}`;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ async function run(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
await execute(await getPodmanPath(), args);
|
await execute(await getPodmanPath(), args);
|
||||||
core.info(`Successfully pushed ${imageWithTag} to ${registryPath}.`);
|
core.info(`Successfully pushed ${imageWithTag} to ${registryPath}`);
|
||||||
|
|
||||||
registryPathList.push(registryPath);
|
registryPathList.push(registryPath);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ async function run(): Promise<void> {
|
||||||
core.warning(`Failed to read digest file "${digestFile}": ${err}`);
|
core.warning(`Failed to read digest file "${digestFile}": ${err}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.setOutput("registry-paths", registryPathList.toString());
|
core.setOutput("registry-paths", JSON.stringify(registryPathList));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function pullImageFromDocker(): Promise<boolean> {
|
async function pullImageFromDocker(): Promise<boolean> {
|
||||||
|
@ -154,7 +154,7 @@ async function pullImageFromDocker(): Promise<boolean> {
|
||||||
|
|
||||||
async function checkImageInPodman(): Promise<boolean> {
|
async function checkImageInPodman(): Promise<boolean> {
|
||||||
// check if images exist in Podman's storage
|
// check if images exist in Podman's storage
|
||||||
core.info(`Checking if ${imageToPush} with tag(s) ${tagsList.toString()} is present in Podman image storage`);
|
core.info(`Checking if ${imageToPush} with tag(s) ${tagsList.join(", ")} is present in Podman image storage`);
|
||||||
let imageWithTag;
|
let imageWithTag;
|
||||||
try {
|
try {
|
||||||
for (const tag of tagsList) {
|
for (const tag of tagsList) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue