Skip to content

Commit

Permalink
Merge branch 'main' into feat-publish-package-from-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb authored Sep 30, 2024
2 parents 47ba45a + c196cbb commit dd95798
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 15 additions & 9 deletions .github/workflows/build_container_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,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
Expand Down Expand Up @@ -100,10 +102,15 @@ 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)
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]')
echo "Setting $dependency_name to $dependency_version"
npm pkg set dependencies.$dependency_name=$dependency_semver
echo "### :package: $dependency_name version: $dependency_semver" >> $GITHUB_STEP_SUMMARY
done
cat package.json
Expand All @@ -126,8 +133,7 @@ jobs:
load: true
push: true
provenance: false
build-args: |
BUILD_TAG=${{ env.build_tag }}
build-args: ${{ inputs.build_arguments }}

- name: Scan container image for vulnerabilities
if: ${{ fromJson(inputs.scan_image) }}
Expand Down

0 comments on commit dd95798

Please sign in to comment.