mirror of
https://github.com/walter-base/common-workflow.git
synced 2026-09-08 19:26:46 -04:00
fix: include catalog description in npm metadata
This commit is contained in:
@@ -253,6 +253,7 @@ jobs:
|
|||||||
NPM_REGISTRY: ${{ inputs.npm_registry }}
|
NPM_REGISTRY: ${{ inputs.npm_registry }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITEA_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITEA_TOKEN }}
|
||||||
PACKAGE_PATHS: ${{ inputs.package_paths }}
|
PACKAGE_PATHS: ${{ inputs.package_paths }}
|
||||||
|
CATALOG_FILE: ${{ inputs.catalog_file }}
|
||||||
VERSION: ${{ needs.release-please.outputs.version }}
|
VERSION: ${{ needs.release-please.outputs.version }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -278,11 +279,16 @@ jobs:
|
|||||||
# package and the generic archive can never drift apart.
|
# package and the generic archive can never drift apart.
|
||||||
pkg_dir="dist/${ARCHIVE_NAME}-${VERSION}"
|
pkg_dir="dist/${ARCHIVE_NAME}-${VERSION}"
|
||||||
files_json="$(printf '%s\n' ${PACKAGE_PATHS} | jq -R . | jq -s .)"
|
files_json="$(printf '%s\n' ${PACKAGE_PATHS} | jq -R . | jq -s .)"
|
||||||
|
description=""
|
||||||
|
if [[ -n "$CATALOG_FILE" ]]; then
|
||||||
|
description="$(jq -r '.description // empty' "$CATALOG_FILE")"
|
||||||
|
fi
|
||||||
jq -n \
|
jq -n \
|
||||||
--arg name "$NPM_PACKAGE_NAME" \
|
--arg name "$NPM_PACKAGE_NAME" \
|
||||||
--arg version "$VERSION" \
|
--arg version "$VERSION" \
|
||||||
|
--arg description "$description" \
|
||||||
--argjson files "$files_json" \
|
--argjson files "$files_json" \
|
||||||
'{name: $name, version: $version, files: $files, private: false}' \
|
'{name: $name, version: $version, files: $files, private: false} + (if $description == "" then {} else {description: $description} end)' \
|
||||||
> "${pkg_dir}/package.json"
|
> "${pkg_dir}/package.json"
|
||||||
|
|
||||||
# `npm pack <path>` without a leading `./` is parsed as a GitHub owner/repo
|
# `npm pack <path>` without a leading `./` is parsed as a GitHub owner/repo
|
||||||
|
|||||||
Reference in New Issue
Block a user