mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-28 23:31:02 +00:00
feat: added debugging
This commit is contained in:
45
.github/workflows/beta.yml
vendored
45
.github/workflows/beta.yml
vendored
@@ -96,6 +96,10 @@ jobs:
|
||||
- name: Upload APK to Discord and Telegram
|
||||
shell: bash
|
||||
run: |
|
||||
# Debugging: Print the COMMIT_LOG
|
||||
echo "COMMIT_LOG contents:"
|
||||
echo "$COMMIT_LOG"
|
||||
|
||||
# Prepare Discord embed
|
||||
fetch_user_details() {
|
||||
local login=$1
|
||||
@@ -114,6 +118,10 @@ jobs:
|
||||
# Extract contributor names from commit log and make unique list
|
||||
committers=$(echo "$COMMIT_LOG" | sed 's/%0A/\n/g' | grep -oP '(?<=~)[^%]*' | sort | uniq)
|
||||
|
||||
# Debugging: Print extracted committers
|
||||
echo "Extracted committers:"
|
||||
echo "$committers"
|
||||
|
||||
# Initialize needed variables
|
||||
developers=""
|
||||
committers_count=0
|
||||
@@ -121,19 +129,30 @@ jobs:
|
||||
|
||||
# Process contributors and filter by committers
|
||||
while read -r committer; do
|
||||
echo "Processing committer: $committer"
|
||||
|
||||
# Get commit count for this committer on the dev branch
|
||||
commit_count=$(git rev-list --count dev --author="$committer")
|
||||
echo "Commit count for $committer: $commit_count"
|
||||
|
||||
# Only proceed if the committer has commits on the dev branch
|
||||
if [ "$commit_count" -gt 0 ]; then
|
||||
echo "Fetching user details for $committer"
|
||||
user_info=$(fetch_user_details "$committer")
|
||||
echo "User info: $user_info"
|
||||
|
||||
name=$(echo "$user_info" | cut -d'|' -f1)
|
||||
login=$(echo "$user_info" | cut -d'|' -f2)
|
||||
avatar_url=$(echo "$user_info" | cut -d'|' -f3)
|
||||
|
||||
echo "Name: $name, Login: $login, Avatar URL: $avatar_url"
|
||||
|
||||
extra_info="${additional_info[$name]}"
|
||||
if [ -n "$extra_info" ]; then
|
||||
extra_info=$(echo -e "$extra_info" | sed 's/^/- /')
|
||||
echo "Extra info found for $name"
|
||||
else
|
||||
echo "No extra info found for $name"
|
||||
fi
|
||||
|
||||
developers="${developers}◗ **${name}**
|
||||
@@ -146,9 +165,18 @@ jobs:
|
||||
else
|
||||
thumbnail_url="https://i.imgur.com/5o3Y9Jb.gif"
|
||||
fi
|
||||
|
||||
echo "Current developers string:"
|
||||
echo "$developers"
|
||||
else
|
||||
echo "Skipping $committer (no commits on dev branch)"
|
||||
fi
|
||||
done < <(echo "$committers")
|
||||
|
||||
# Debugging: Print final developers string
|
||||
echo "Final developers string:"
|
||||
echo "$developers"
|
||||
|
||||
# Remove trailing newline
|
||||
developers=$(echo "$developers" | sed '$ s/$//')
|
||||
commit_messages=$(echo "$COMMIT_LOG" | sed 's/%0A/\n/g; s/^/\n/')
|
||||
@@ -161,7 +189,13 @@ jobs:
|
||||
if [ ${#commit_messages} -gt $max_length ]; then
|
||||
commit_messages="${commit_messages:0:$max_length}... (truncated)"
|
||||
fi
|
||||
|
||||
|
||||
# Debugging: Print final commit messages and developers
|
||||
echo "Final commit messages:"
|
||||
echo "$commit_messages"
|
||||
echo "Final developers (after truncation):"
|
||||
echo "$developers"
|
||||
|
||||
# Construct Discord payload
|
||||
discord_data=$(jq -nc \
|
||||
--arg field_value "$commit_messages" \
|
||||
@@ -170,7 +204,7 @@ jobs:
|
||||
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
|
||||
--arg thumbnail_url "$thumbnail_url" \
|
||||
'{
|
||||
"content": "<@&1225347048321191996>",
|
||||
"content": "<@&1209682006376710185>",
|
||||
"embeds": [
|
||||
{
|
||||
"title": "New Alpha-Build dropped",
|
||||
@@ -198,6 +232,11 @@ jobs:
|
||||
],
|
||||
"attachments": []
|
||||
}')
|
||||
|
||||
# Debugging: Print Discord payload
|
||||
echo "Discord payload:"
|
||||
echo "$discord_data"
|
||||
|
||||
# Send Discord message
|
||||
curl -H "Content-Type: application/json" \
|
||||
-d "$discord_data" \
|
||||
@@ -213,7 +252,7 @@ jobs:
|
||||
# -F "document=@app/build/outputs/apk/google/alpha/app-google-alpha.apk" \
|
||||
# -F "caption=Alpha-Build: ${VERSION}: ${commit_messages}" \
|
||||
# https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument
|
||||
|
||||
|
||||
env:
|
||||
COMMIT_LOG: ${{ env.COMMIT_LOG }}
|
||||
VERSION: ${{ env.VERSION }}
|
||||
|
||||
Reference in New Issue
Block a user