From 634942733c55ceba4d3c818596866ae12d2ca8df Mon Sep 17 00:00:00 2001 From: Jason Nagin <33561705+JasonN3@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:54:45 +0000 Subject: [PATCH] use xargs and add usage example --- README.md | 33 ++++++++++++++++++++++++++++++++- docs/Makefile | 7 +++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 53d9e5f..26a3de9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,38 @@ # Build Container Installer Action -This action is used to generate an ISO for installing an OSTree stored in a container image. This utilizes the anaconda command `ostreecontainer`, which also support bootc. +This action is used to generate an ISO for installing an OSTree stored in a container image. This utilizes the anaconda command `ostreecontainer`, which also supports bootc. + +## Usage + +This action is designed to be called from a GitHub workflow using the following format + +```yaml +- name: Build ISO + uses: jasonn3/build-container-installer@main + id: build + with: + arch: ${{ env.ARCH}} + image_name: ${{ env.IMAGE_NAME}} + image_repo: ${{ env.IMAGE_REPO}} + image_tag: ${{ env.IMAGE_TAG }} + version: ${{ env.VERSION }} + variant: ${{ env.VARIANT }} + iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso + +# This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output +- name: Upload ISO as artifact + id: upload + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.iso_name }} + path: | + ${{ steps.build.outputs.iso_path }} + ${{ steps.build.outputs.iso_path }}-CHECKSUM + if-no-files-found: error + retention-days: 0 + compression-level: 0 +``` **See the [Wiki](https://github.com/JasonN3/build-container-installer/wiki) for development and usage information.** diff --git a/docs/Makefile b/docs/Makefile index 2ea5ded..21029af 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,13 +1,12 @@ SHELL = /bin/bash docs: - find -name '*.md' | while read -r line; \ - do \ - source_file=$${line:2}; \ + find -name '*.md' -print0 | xargs -0 -I {} bash -c ' \ + source_file=$${1:2}; \ final_file=$${source_file//\//_}; \ mv "$${source_file}" "$${final_file}"; \ no_ext_source=$${source_file:0:-3}; \ no_ext_final=$${final_file:0:-3}; \ sed -i "s;(\(../\)*$${source_file});($${no_ext_final});g" $$(find -name '*.md'); \ - done + ' _ {} find . -type d -empty -delete