Skip to content

Commit 1b559aa

Browse files
committed
Extract stable release notes from https://noscript.net/changelog.
1 parent c0f4148 commit 1b559aa

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/manage-releases.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,13 @@ jobs:
7070
with:
7171
fetch-depth: 0
7272

73-
- name: Extract changelog from regular tag annotation
73+
- name: Extract changelog
7474
id: changelog
7575
env:
7676
VER: ${{ steps.meta.outputs.version }}
77+
PRERELEASE: ${{ steps.meta.outputs.prerelease }}
7778
run: |
7879
COMMIT=$(git rev-parse HEAD)
79-
80-
# Try VER as-is, then with trailing .0 components stripped
81-
# (handles the 13.5.0.1984 → regular tag "13.5" case).
8280
VER_SHORT="${VER%.0}"
8381
VER_SHORTER="${VER_SHORT%.0}"
8482
@@ -95,8 +93,19 @@ jobs:
9593
echo "No regular tag found on this commit for '$VER'; changelog will be empty." >&2
9694
touch /tmp/changelog.md
9795
else
98-
git tag -l --format='%(contents)' "$REG_TAG" > /tmp/changelog.md
99-
echo "Using annotation from tag '$REG_TAG'."
96+
if [[ "$PRERELEASE" == "true" ]]; then
97+
# Pre-release: extract from tag annotation
98+
git tag -l --format='%(contents)' "$REG_TAG" > /tmp/changelog.md
99+
echo "Using annotation from tag '$REG_TAG'."
100+
else
101+
# Extract the version from REG_TAG (remove leading 'v' if present)
102+
CHANGELOG_VER="${REG_TAG#v}"
103+
echo "Fetching changelog for stable release ${CHANGELOG_VER} from noscript.net..."
104+
CHANGELOG_VER_ESCAPED="${CHANGELOG_VER//./\.}"
105+
curl -L "https://noscript.net/changelog" | \
106+
grep -A1000 "v $CHANGELOG_VER_ESCAPED$" | \
107+
grep -m1 -B1000 '^$' > /tmp/changelog.md
108+
fi
100109
fi
101110
102111
- name: Download XPI from dist.torproject.org

0 commit comments

Comments
 (0)