prep-changelog-config.sh 469 B

12345678910111213
  1. #!/bin/bash
  2. # Remove "refs/tags/"
  3. tag="${GITHUB_REF##*/}"
  4. # Extract crate name
  5. crate=$(echo $tag | sed 's/-v[0-9].*//g')
  6. # Semver portion follows after the ${crate}-v
  7. tagPattern="${crate}-v(.+)"
  8. echo ::group::Configuring changelog generator
  9. jq '.tag_resolver.filter.pattern="'$tagPattern'" | .tag_resolver.transformer.pattern="'$tagPattern'" | .categories[].labels += ["'$crate'"]' \
  10. .github/changelog-base.json | tee .github/changelog-config.json
  11. echo ::endgroup::