Compare commits

...

6 commits
v2.11 ... main

Author SHA1 Message Date
divyansh42
7a95fa7ee0 Update changelog
Signed-off-by: divyansh42 <diagrawa@redhat.com>
2024-03-05 17:11:53 +05:30
divyansh42
1ec5690277 Turn-off CRDA workflows temporarily
Signed-off-by: divyansh42 <diagrawa@redhat.com>
2024-03-05 17:08:11 +05:30
Philipp Trulson
c79846fb30
Update Action to Node 20 (#128)
* Update GitHub Actions workflows to latest versions

* Update dependencies & run on Node 20
2024-02-01 21:52:34 +05:30
divyansh42
b4dc19b4ba Update changelog
Signed-off-by: divyansh42 <diagrawa@redhat.com>
2023-02-09 15:16:26 +05:30
dependabot[bot]
5f55f580e1
Bump json5 from 1.0.1 to 1.0.2 (#117)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-09 15:08:58 +05:30
Philipp Trulson
6c6c802bcc
Forcibly remove existing manifest before creating a new one (#103)
* Remove existing manifest

* Always execute manifest rm
2023-02-09 15:08:33 +05:30
17 changed files with 523 additions and 610 deletions

View file

@ -16,7 +16,7 @@ env:
jobs:
build:
name: Build image using Buildah
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -26,7 +26,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: "buildah-build"

View file

@ -6,21 +6,21 @@ on:
jobs:
lint:
name: Run ESLint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint
check-dist:
name: Check Distribution
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
BUNDLE_FILE: "dist/index.js"
BUNDLE_COMMAND: "npm run bundle"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install
run: npm ci
@ -33,11 +33,11 @@ jobs:
check-inputs-outputs:
name: Check Input and Output enums
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
IO_FILE: ./src/generated/inputs-outputs.ts
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci

View file

@ -15,7 +15,7 @@ env:
jobs:
build:
name: Build image using Buildah
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -25,7 +25,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: "buildah-build"

View file

@ -12,7 +12,7 @@ on:
jobs:
build-containerfile:
name: Build image with Containerfile
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -25,7 +25,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Metadata
id: docker-metadata
@ -88,7 +88,7 @@ jobs:
build-scratch:
name: Build image without Containerfile
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -103,7 +103,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Metadata
id: docker-metadata
@ -128,7 +128,7 @@ jobs:
# Checkout spring-petclinic github repository
- name: Checkout spring-petclinic project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "spring-projects/spring-petclinic"
path: ${{ env.PROJECT_DIR }}

View file

@ -12,9 +12,9 @@ on:
jobs:
markdown-link-check:
name: Check links in markdown
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: true

View file

@ -16,7 +16,7 @@ jobs:
name: Build multi-architecture image using Containerfile
env:
IMAGE_NAME: hello-world-multiarch
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -26,7 +26,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: "buildah-build"
@ -84,7 +84,7 @@ jobs:
name: Build multi-platform image using Containerfile
env:
IMAGE_NAME: hello-world-multiplatform
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -94,7 +94,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: "buildah-build"
@ -151,7 +151,7 @@ jobs:
name: Build multi-architecture image from scratch
env:
IMAGE_NAME: spring-petclinic-multiarch
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -161,7 +161,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: "buildah-build"
@ -177,7 +177,7 @@ jobs:
# Checkout spring-petclinic github repository
- name: Checkout spring-petclinic project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "spring-projects/spring-petclinic"
path: ${{ env.PROJECT_DIR }}

View file

@ -17,7 +17,7 @@ env:
jobs:
build:
name: Build image using Buildah
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
@ -27,7 +27,7 @@ jobs:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: "buildah-build"
@ -38,7 +38,7 @@ jobs:
# Checkout spring-petclinic github repository
- name: Checkout spring-petclinic project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "spring-projects/spring-petclinic"
path: ${{ env.PROJECT_DIR }}

View file

@ -1,24 +1,24 @@
name: Vulnerability Scan with CRDA
on:
push:
# push:
workflow_dispatch:
pull_request_target:
types: [ assigned, opened, synchronize, reopened, labeled, edited ]
schedule:
- cron: '0 0 * * *' # every day at midnight
# pull_request_target:
# types: [ assigned, opened, synchronize, reopened, labeled, edited ]
# schedule:
# - cron: '0 0 * * *' # every day at midnight
jobs:
crda-scan:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: Scan project vulnerability with CRDA
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'
cache: 'npm'
- name: Install CRDA

View file

@ -1,5 +1,11 @@
# buildah-build Changelog
## v2.13
- Update action to run on Node20. https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
## v2.12
- Forcibly remove existing manifest before creating a new one. [#103](https://github.com/redhat-actions/buildah-build/pull/103)
## v2.11
- Update action to run on Node16. https://github.blog/changelog/2022-05-20-actions-can-now-run-in-a-node-js-16-runtime/

View file

@ -126,7 +126,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Buildah Action
uses: redhat-actions/buildah-build@v2
@ -166,7 +166,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: mvn package

View file

@ -90,5 +90,5 @@ outputs:
image-with-tag:
description: 'Name of the image tagged with the first tag present'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'

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

1003
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
{
"name": "buildah-build",
"version": "2.0",
"version": "3.0",
"engines": {
"node": "16"
"node": "20"
},
"description": "Action for building OCI-compatible images using buildah",
"repository": {
@ -21,21 +21,21 @@
"author": "Red Hat",
"license": "MIT",
"dependencies": {
"@actions/core": "1.10.0",
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1",
"@actions/io": "1.1.2",
"ini": "3.0.1"
"@actions/io": "1.1.3",
"ini": "4.1.1"
},
"devDependencies": {
"@redhat-actions/action-io-generator": "1.5.0",
"@redhat-actions/eslint-config": "1.3.2",
"@redhat-actions/tsconfig": "1.2.0",
"@types/ini": "1.3.31",
"@types/node": "16.18.7",
"@typescript-eslint/eslint-plugin": "5.46.0",
"@typescript-eslint/parser": "5.46.0",
"@vercel/ncc": "0.34.0",
"eslint": "8.29.0",
"typescript": "4.9.4"
"@types/node": "^20.0",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"@vercel/ncc": "0.38.0",
"eslint": "8.50.0",
"typescript": "5.2.2"
}
}

View file

@ -201,6 +201,26 @@ export class BuildahCli implements Buildah {
core.info(`✅ Successfully built image${builtImage.length !== 1 ? "s" : ""} "${builtImage.join(", ")}"`);
}
// Unfortunately buildah doesn't support the exists command yet
// https://github.com/containers/buildah/issues/4217
// async manifestExists(manifest: string): Promise<boolean> {
// const args: string[] = [ "manifest", "exists" ];
// args.push(manifest);
// const execOptions: exec.ExecOptions = {ignoreReturnCode: true};
// core.info(`Checking if manifest ${manifest} exists`);
// const {exitCode} = await this.execute(args, execOptions);
// return exitCode ? false : true;
// }
async manifestRm(manifest: string): Promise<void> {
const execOptions: exec.ExecOptions = { ignoreReturnCode: true };
const args: string[] = [ "manifest", "rm" ];
args.push(manifest);
core.info(`Removing existing manifest ${manifest}`);
await this.execute(args, execOptions);
}
async manifestCreate(manifest: string): Promise<void> {
const args: string[] = [ "manifest", "create" ];
args.push(manifest);

View file

@ -112,6 +112,8 @@ export async function run(): Promise<void> {
const builtManifest = [];
for (const tag of normalizedTagsList) {
const manifestName = getFullImageName(normalizedImage, tag);
// Force-remove existing manifest to prevent errors on recurring build on the same machine
await cli.manifestRm(manifestName);
await cli.manifestCreate(manifestName);
builtManifest.push(manifestName);