Skip to content

Commit

Permalink
Update changelog when manifest update
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Dec 25, 2022
1 parent 46063c1 commit f1a96ee
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ci/manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ for manifest in manifests/*.json; do
git add -N "${manifest}"
if ! git diff --exit-code -- "${manifest}"; then
name="$(basename "${manifest%.*}")"
git add "${manifest}"
git commit -m "Update ${name}"
git stash
old_version=$(jq -r '.latest.version' "${manifest}")
git stash pop
new_version=$(jq -r '.latest.version' "${manifest}")
if [[ "${old_version}" != "${new_version}" ]]; then
msg="Update \`${name}@latest\` to ${new_version}"
sed -i "s/^## \\[Unreleased\\]/## [Unreleased]\\n\\n- ${msg}./" CHANGELOG.md
git add "${manifest}" CHANGELOG.md
else
msg="Update ${name} manifest"
git add "${manifest}"
fi
git commit -m "${msg}"
has_update=1
fi
done

if [[ -n "${has_update:-}" ]]; then
if [[ -n "${has_update:-}" ]] && [[ -n "${GITHUB_OUTPUT:-}" ]]; then
echo "success=false" >>"${GITHUB_OUTPUT}"
fi

0 comments on commit f1a96ee

Please sign in to comment.