From 64788d3d9e8acc3650d35fae824f08873c4bdb34 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Wed, 25 Sep 2024 19:28:26 +0200 Subject: [PATCH 01/13] Refactor approach to dependencies; add possibility to define custom container build arguments --- .github/workflows/build_container_image.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index e8c88b6..34ad049 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -7,6 +7,11 @@ on: description: 'AWS access key ID' type: string required: false + build_arguments: + description: 'Build arguments' + type: string + required: false + default: '' build_context: description: 'Path to the build context' type: string @@ -100,10 +105,11 @@ jobs: echo "## Packages used to build image" >> $GITHUB_STEP_SUMMARY for dependency in $(echo "${{ inputs.package_dependencies }}" | tr '\n' ' ') do - echo "Updating $dependency to ${{ env.release_name }}" - cat package.json | jq ".dependencies[\"$dependency\"] = \"${{ env.release_name }}\"" > package.json-patched - mv package.json-patched package.json - echo "### :package: $dependency version: $(npm show $dependency dist-tags --json | jq -r '.${{ env.release_name }}')" >> $GITHUB_STEP_SUMMARY + dependency_name=$(echo $dependency | cut -d'=' -f1) + dependency_version=$(echo $dependency | cut -d'=' -f2) + echo "Setting $dependency_name to $dependency_version" + npm pkg set dependencies.$dependency + echo "### :package: $dependency_name version: $dependency_version >> $GITHUB_STEP_SUMMARY done cat package.json @@ -126,8 +132,9 @@ jobs: load: true push: true provenance: false - build-args: | - BUILD_TAG=${{ env.build_tag }} + build-args: ${{ inputs.build_arguments }} + # build-args: | + # BUILD_TAG=${{ env.build_tag }} - name: Scan container image for vulnerabilities if: ${{ fromJson(inputs.scan_image) }} From 01cb953e87cb50d3c32226428ff9fa3817968983 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Wed, 25 Sep 2024 22:56:36 +0200 Subject: [PATCH 02/13] Typo fix --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 34ad049..e0eb532 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -109,7 +109,7 @@ jobs: dependency_version=$(echo $dependency | cut -d'=' -f2) echo "Setting $dependency_name to $dependency_version" npm pkg set dependencies.$dependency - echo "### :package: $dependency_name version: $dependency_version >> $GITHUB_STEP_SUMMARY + echo "### :package: $dependency_name version: $dependency_version >> $GITHUB_STEP_SUMMARY" done cat package.json From 890aea4b04d696d8ae57560cbbd97843d106619b Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Wed, 25 Sep 2024 23:13:31 +0200 Subject: [PATCH 03/13] Typo fix --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index e0eb532..4ce99cb 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -109,7 +109,7 @@ jobs: dependency_version=$(echo $dependency | cut -d'=' -f2) echo "Setting $dependency_name to $dependency_version" npm pkg set dependencies.$dependency - echo "### :package: $dependency_name version: $dependency_version >> $GITHUB_STEP_SUMMARY" + echo "### :package: $dependency_name version: $dependency_version" >> $GITHUB_STEP_SUMMARY done cat package.json From 345f31ab76b9093430c33e39e6dc4ae4c85b5b44 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Thu, 26 Sep 2024 19:28:46 +0200 Subject: [PATCH 04/13] Cleanup --- .github/workflows/build_container_image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 4ce99cb..cd5add5 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -133,8 +133,6 @@ jobs: push: true provenance: false build-args: ${{ inputs.build_arguments }} - # build-args: | - # BUILD_TAG=${{ env.build_tag }} - name: Scan container image for vulnerabilities if: ${{ fromJson(inputs.scan_image) }} From f30aaa59e890e4a817a93a0a5a253af972acdb33 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 10:27:36 +0200 Subject: [PATCH 05/13] Remove unused `npm_registry_auth_token` secret --- .github/workflows/build_container_image.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index cd5add5..0d359e7 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -50,9 +50,6 @@ on: type: boolean default: false secrets: - npm_registry_auth_token: - description: 'NPM registry authentication token' - required: false temporary_registry_token: description: 'GitHub token' required: true From a82d076e8ae553e9e60be987dd1cb172fd14abd0 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 11:37:33 +0200 Subject: [PATCH 06/13] Fix package version print --- .github/workflows/build_container_image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 0d359e7..38ab35f 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -104,9 +104,10 @@ jobs: do dependency_name=$(echo $dependency | cut -d'=' -f1) dependency_version=$(echo $dependency | cut -d'=' -f2) + dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r '.nightly') echo "Setting $dependency_name to $dependency_version" npm pkg set dependencies.$dependency - echo "### :package: $dependency_name version: $dependency_version" >> $GITHUB_STEP_SUMMARY + echo "### :package: $dependency_name version: $dependency_semver" >> $GITHUB_STEP_SUMMARY done cat package.json From 48dc4ede112142b812d502cb28f78fd8f3d5a596 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 12:38:17 +0200 Subject: [PATCH 07/13] Fix package version print --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 38ab35f..48cb42e 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -104,7 +104,7 @@ jobs: do dependency_name=$(echo $dependency | cut -d'=' -f1) dependency_version=$(echo $dependency | cut -d'=' -f2) - dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r '.nightly') + dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r '.$dependency_version') echo "Setting $dependency_name to $dependency_version" npm pkg set dependencies.$dependency echo "### :package: $dependency_name version: $dependency_semver" >> $GITHUB_STEP_SUMMARY From 4a9fdab6772f23438e1de2dce52e6c1ff7f354c2 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 12:42:23 +0200 Subject: [PATCH 08/13] Fix package version print --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 48cb42e..7e90a12 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -104,7 +104,7 @@ jobs: do dependency_name=$(echo $dependency | cut -d'=' -f1) dependency_version=$(echo $dependency | cut -d'=' -f2) - dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r '.$dependency_version') + dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r --arg version "$dependency_version" '.[$version]') echo "Setting $dependency_name to $dependency_version" npm pkg set dependencies.$dependency echo "### :package: $dependency_name version: $dependency_semver" >> $GITHUB_STEP_SUMMARY From f48c9d680322cf5eb73a468229c1d3e6d3e7d416 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 13:08:40 +0200 Subject: [PATCH 09/13] Set default value for dependency version --- .github/workflows/build_container_image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 7e90a12..33ffb1f 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -104,6 +104,9 @@ jobs: do dependency_name=$(echo $dependency | cut -d'=' -f1) dependency_version=$(echo $dependency | cut -d'=' -f2) + if [ -z "$dependency_version" ]; then + dependency_version="latest" + fi dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r --arg version "$dependency_version" '.[$version]') echo "Setting $dependency_name to $dependency_version" npm pkg set dependencies.$dependency From 8ca73a75a2986e7231563de14cf3f36863fd9a6a Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 13:13:24 +0200 Subject: [PATCH 10/13] Set dependency version to latest if non is specified --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 33ffb1f..1920c1e 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -104,7 +104,7 @@ jobs: do dependency_name=$(echo $dependency | cut -d'=' -f1) dependency_version=$(echo $dependency | cut -d'=' -f2) - if [ -z "$dependency_version" ]; then + if [ "$dependency_name" == "$dependency_version" ]; then dependency_version="latest" fi dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r --arg version "$dependency_version" '.[$version]') From 6474df5317a5582dd782d622e8c31d61992fa763 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 13:19:29 +0200 Subject: [PATCH 11/13] Fix dependency set if version not provided --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 1920c1e..3f8bafd 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -109,7 +109,7 @@ jobs: fi dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r --arg version "$dependency_version" '.[$version]') echo "Setting $dependency_name to $dependency_version" - npm pkg set dependencies.$dependency + npm pkg set dependencies.$dependency_name@$dependency_semver echo "### :package: $dependency_name version: $dependency_semver" >> $GITHUB_STEP_SUMMARY done cat package.json From 68a4d713591400a9fd834d1d285078e31a5c639a Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 27 Sep 2024 13:21:56 +0200 Subject: [PATCH 12/13] Typo fix --- .github/workflows/build_container_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index 3f8bafd..593a878 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -109,7 +109,7 @@ jobs: fi dependency_semver=$(npm view $dependency_name dist-tags --json | jq -r --arg version "$dependency_version" '.[$version]') echo "Setting $dependency_name to $dependency_version" - npm pkg set dependencies.$dependency_name@$dependency_semver + npm pkg set dependencies.$dependency_name=$dependency_semver echo "### :package: $dependency_name version: $dependency_semver" >> $GITHUB_STEP_SUMMARY done cat package.json From 6699dc0424c88f82ce650712024713c831919370 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:36:41 +0200 Subject: [PATCH 13/13] Bump anothrNick/github-tag-action from 1.70.0 to 1.71.0 (#72) Bumps [anothrNick/github-tag-action](https://github.com/anothrnick/github-tag-action) from 1.70.0 to 1.71.0. - [Release notes](https://github.com/anothrnick/github-tag-action/releases) - [Commits](https://github.com/anothrnick/github-tag-action/compare/1.70.0...1.71.0) --- updated-dependencies: - dependency-name: anothrNick/github-tag-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/autotag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autotag.yml b/.github/workflows/autotag.yml index f3038f1..461f868 100644 --- a/.github/workflows/autotag.yml +++ b/.github/workflows/autotag.yml @@ -21,7 +21,7 @@ jobs: fetch-depth: '0' - name: Bump version and push tag - uses: anothrNick/github-tag-action@1.70.0 + uses: anothrNick/github-tag-action@1.71.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true