From 9597e041da3f8d57b175d6513a9086f65536227e Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 1 Aug 2024 15:49:05 +0200 Subject: [PATCH] fix(release-notes-assistant): categorize multiline drafts & cleanup Upgrade to release-notes-assistant 1.1.1: * multiline release notes drafts were incorrectly categorized according the first line, instead of for each line * when there is a backport, link the original PR first * remove spurious --- .../release-notes-assistant-milestones.yml | 33 +++++++++++++++++++ .../workflows/release-notes-assistant.yml | 2 +- release-notes-assistant.sh | 4 +-- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .forgejo/workflows/release-notes-assistant-milestones.yml diff --git a/.forgejo/workflows/release-notes-assistant-milestones.yml b/.forgejo/workflows/release-notes-assistant-milestones.yml new file mode 100644 index 000000000..361e8f441 --- /dev/null +++ b/.forgejo/workflows/release-notes-assistant-milestones.yml @@ -0,0 +1,33 @@ +on: + workflow_dispatch: + + schedule: + - cron: '@daily' + +jobs: + release-notes: + if: ${{ !startsWith(vars.ROLE, 'forgejo-') + runs-on: docker + container: + image: 'docker.io/node:20-bookworm' + steps: + - uses: https://code.forgejo.org/actions/checkout@v3 + + - uses: https://code.forgejo.org/actions/setup-go@v4 + with: + go-version-file: "go.mod" + cache: false + + - name: apt install jq + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get -q install -y -qq jq + + - name: update open milestones + run: | + set -x + curl -sS $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/milestones?state=open | jq -r '.[] | .title' | while read forgejo version ; do + milestone="$forgejo $version" + go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version + done diff --git a/.forgejo/workflows/release-notes-assistant.yml b/.forgejo/workflows/release-notes-assistant.yml index cd76e412c..433d9c435 100644 --- a/.forgejo/workflows/release-notes-assistant.yml +++ b/.forgejo/workflows/release-notes-assistant.yml @@ -36,4 +36,4 @@ jobs: - name: release-notes-assistant preview run: | - go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.0 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }} + go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }} diff --git a/release-notes-assistant.sh b/release-notes-assistant.sh index e8eb7ef2a..630fa9153 100755 --- a/release-notes-assistant.sh +++ b/release-notes-assistant.sh @@ -48,7 +48,7 @@ function test_main() { test "$(categorize)" = 'ZE Other changes without a feature or bug label' test_payload_labels - test "$(categorize)" = 'ZF Included for completness but not worth a release note' + test "$(categorize)" = 'ZF Included for completeness but not worth a release note' test_payload_draft "feat!: breaking feature" test "$(categorize)" = 'AA Breaking features' @@ -99,7 +99,7 @@ function categorize() { # if test -z "$(jq --raw-output .Draft <$payload)"; then if ! $worth; then - echo -n ZF Included for completness but not worth a release note + echo -n ZF Included for completeness but not worth a release note exit 0 fi fi