Add verify bundle action and make inputs 'required'

Signed-off-by: Tim Etchells <tetchell@redhat.com>
This commit is contained in:
Tim Etchells 2020-11-17 14:19:05 -05:00
parent 05f033c95a
commit 61095317bf
8 changed files with 86 additions and 18 deletions

22
.github/workflows/verify-bundle.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Verify Bundle
on: [ push, pull_request ]
jobs:
verify-bundle:
name: Verify Distribution Bundle
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Check Distribution
uses: tetchel/bundle-verifier-action@v0.0.2
with:
bundle_file: dist/index.js
bundle_command: "npm run bundle"

View file

@ -1,5 +1,6 @@
# push-to-registry
[![Verify Bundle](https://github.com/redhat-actions/push-to-registry/workflows/Verify%20Bundle/badge.svg)](https://github.com/redhat-actions/push-to-registry/actions?query=workflow%3A%22Verify+Bundle%22)
[![tag badge](https://img.shields.io/github/v/tag/redhat-actions/push-to-registry?sort=semver)](https://github.com/redhat-actions/push-to-registry/tags)
[![license badge](https://img.shields.io/github/license/redhat-actions/push-to-registry)](./LICENSE)
[![size badge](https://img.shields.io/github/size/redhat-actions/push-to-registry/dist/index.js)](./dist)
@ -18,7 +19,7 @@ Push-to-registry is a GitHub Action for pushing an OCI-compatible image to an im
</thead>
<tr>
<td>image-to-push</td>
<td>image</td>
<td>Yes</td>
<td>
Name of the image you want to push. Most likely the name you used to create the image in the previous step.
@ -92,7 +93,7 @@ jobs:
- name: Push To Quay
uses: redhat-actions/push-to-registry@0.0.1
with:
image-to-push: ${{ env.IMAGE_NAME }}
image: ${{ env.IMAGE_NAME }}
registry: ${{ secrets.QUAY_REPO }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

View file

@ -5,15 +5,15 @@ branding:
icon: circle
color: red
inputs:
image-to-push:
description: 'Name of the new image that will be pushed'
image:
description: 'Name of the image to push'
required: true
tag:
description: 'Tag of the new image'
description: 'Tag of the image to push'
required: false
default: 'latest'
registry:
description: 'Registry where to push the image (e.g quay.io/username)'
description: 'Registry where to push the image (eg. quay.io/username)'
required: true
username:
description: 'Username to use as credential to authenticate to the registry'

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

44
package-lock.json generated Normal file
View file

@ -0,0 +1,44 @@
{
"name": "push-to-registry",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
},
"@actions/exec": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz",
"integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==",
"requires": {
"@actions/io": "^1.0.1"
}
},
"@actions/io": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz",
"integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
},
"@types/node": {
"version": "12.19.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.4.tgz",
"integrity": "sha512-o3oj1bETk8kBwzz1WlO6JWL/AfAA3Vm6J1B3C9CsdxHYp7XgPiH7OEXPUbZTndHlRaIElrANkQfe6ZmfJb3H2w==",
"dev": true
},
"@vercel/ncc": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.25.1.tgz",
"integrity": "sha512-dGecC5+1wLof1MQpey4+6i2KZv4Sfs6WfXkl9KfO32GED4ZPiKxRfvtGPjbjZv0IbqMl6CxtcV1RotXYfd5SSA==",
"dev": true
},
"typescript": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
"dev": true
}
}
}

View file

@ -18,6 +18,7 @@
},
"devDependencies": {
"@types/node": "^12.12.7",
"@vercel/ncc": "^0.25.1",
"typescript": "^4.0.5"
}
}

View file

@ -4,11 +4,11 @@ import * as io from '@actions/io';
import { CommandResult } from './types';
export async function run(): Promise<void> {
let imageToPush = core.getInput('image-to-push');
let imageToPush = core.getInput('image', { required: true });
const tag = core.getInput('tag') || 'latest';
const registry = core.getInput('registry');
const username = core.getInput('username');
const password = core.getInput('password');
const registry = core.getInput('registry', { required: true });
const username = core.getInput('username', { required: true });
const password = core.getInput('password', { required: true });
// get podman cli
const podman = await io.which('podman', true);