Skip to content

Commit b88bf2c

Browse files
vyppkarwasz
authored andcommitted
Fix review kit injection in generate-email.sh
1 parent c79ae32 commit b88bf2c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/generate-email.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ fail_for_invalid_args() {
3737

3838
# Constants
3939
PROJECT_NAME="Apache Log4j"
40-
PROJECT_SITE="https://logging.apache.org/log4j"
40+
PROJECT_ID="log4j"
41+
PROJECT_SITE="https://logging.apache.org/$PROJECT_ID"
4142
PROJECT_STAGING_SITE="${PROJECT_SITE/apache.org/staged.apache.org}"
4243
PROJECT_REPO="https://github.com/apache/logging-log4j2"
43-
PROJECT_DIST_DIR="https://dist.apache.org/repos/dist/dev/logging/log4j"
4444
PROJECT_VERSION="$2"
4545
COMMIT_ID="$3"
46+
PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION"
4647

4748
# Check release notes file
4849
RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-site/antora/modules/ROOT/pages/_release-notes/$PROJECT_VERSION.adoc"
@@ -55,13 +56,17 @@ dump_review_kit() {
5556
wget -q -O - https://raw.githubusercontent.com/apache/logging-parent/main/.github/release-review-kit.txt \
5657
| sed -n '/-----8<-----~( cut here )~-----8<-----/,$p' \
5758
| tail -n +2 \
58-
| sed -r -e "s/@PROJECT_DIST_DIR@/$PROJECT_DIST_DIR/g" -e "s/@PROJECT_VERSION@/$PROJECT_VERSION/g" -e 's!^! !g'
59+
| sed -e "s|^| |g
60+
s|@PROJECT_ID@|$PROJECT_ID|g
61+
s|@PROJECT_VERSION@|$PROJECT_VERSION|g
62+
s|@PROJECT_DIST_URL@|$PROJECT_DIST_URL|g
63+
s|@COMMIT_ID@|${COMMIT_ID:0:8}|g"
5964
}
6065

6166
dump_release_notes() {
6267
awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE" \
63-
| sed -r 's!'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]!#\2!g' \
64-
| sed -r 's!https://github.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)\[(\1/\2#\4)\]!\5!g'
68+
| sed -r -e 's|'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]|#\2|g
69+
s|https://github.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)\[(\1/\2#\4)\]|\5|g'
6570
}
6671

6772
case $1 in
@@ -76,8 +81,8 @@ This is a vote to release the $PROJECT_NAME \`$PROJECT_VERSION\`.
7681
Website: $PROJECT_STAGING_SITE-$PROJECT_VERSION
7782
GitHub: $PROJECT_REPO
7883
Commit: $COMMIT_ID
79-
Distribution: $PROJECT_DIST_DIR
80-
Nexus: https://repository.apache.org/content/repositories/orgapachelogging-<CHECK>
84+
Distribution: $PROJECT_DIST_URL
85+
Nexus: https://repository.apache.org/content/repositories/orgapachelogging-<FIXME>
8186
Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
8287
8388
Please download, test, and cast your votes on this mailing list.

0 commit comments

Comments
 (0)