Skip to content

Commit c789ddb

Browse files
authored
Fix. Marge pull link
1 parent 156c2a7 commit c789ddb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/publish_alpha.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ jobs:
6868
LAST_SHA=$(git rev-list HEAD~10 -n 1)
6969
fi
7070
COMMIT_LOGS=$(git log $LAST_SHA..HEAD --pretty=format:"● %s ~%an [֍](https://github.com/${{ github.repository }}/commit/%H)")
71-
FORMATTED_COMMIT_LOGS=$(echo "$COMMIT_LOGS" | sed -E 's|Merge pull request #([0-9]+) from ([^ ]+)|Merge pull request <a href="https://github.com/${{ github.repository }}/pull/\1">#\1</a> from \2|g')
72-
echo "$FORMATTED_COMMIT_LOGS" > commit_log.txt
71+
FORMATTED_COMMIT_LOGS=$(echo "$COMMIT_LOGS" | sed -E 's/#([0-9]+)/[#\1](https:\/\/github.com\/Shebyyy\/Awery\/pull\/\1)/g')
72+
echo "$COMMIT_LOGS" > commit_log.txt
73+
echo "$FORMATTED_COMMIT_LOGS" > discord_commit_log.txt
7374
echo "COMMIT_LOG<<EOF" >> $GITHUB_ENV
7475
echo "$FORMATTED_COMMIT_LOGS" >> $GITHUB_ENV
7576
echo "EOF" >> $GITHUB_ENV
@@ -127,6 +128,7 @@ jobs:
127128
fi
128129
TRUNCATED_COMMIT_LOG="$COMMIT_LOG"
129130
telegram_commit_messages=$(echo "$TRUNCATED_COMMIT_LOG" | sed 's/%0A/\n/g' | sed -E 's/● (.*) ~(.*) \[֍\]\((.*)\)/● \1 ~\2 <a href="\3">֍<\/a>/')
131+
telegram_commit_messages=$(echo "$telegram_commit_messages" | sed -E 's|Merge pull request #([0-9]+) from ([^ ]+)|Merge pull request <a href="https://github.com/${{ github.repository }}/pull/\1">#\1</a> from \2|g')
130132
formatted_messages="<blockquote>${telegram_commit_messages}</blockquote>"
131133
curl -v -X POST \
132134
"https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument" \
@@ -140,7 +142,7 @@ jobs:
140142
- name: Send Alpha APK to Discord
141143
if: success()
142144
run: |
143-
COMMIT_LOG=$(cat commit_log.txt)
145+
COMMIT_LOG=$(cat discord_commit_log.txt)
144146
if [ ${#COMMIT_LOG} -gt 2000 ]; then
145147
TRUNCATED_LOG=$(echo "$COMMIT_LOG" | head -c 1800)
146148
LAST_COMPLETE=$(echo "$TRUNCATED_LOG" | grep -o "^●.*$" | tail -n 1)

0 commit comments

Comments
 (0)