mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-28 13:31:02 +00:00
feat: use login for git rev-list
This commit is contained in:
48
.github/workflows/beta.yml
vendored
48
.github/workflows/beta.yml
vendored
@@ -115,7 +115,7 @@ jobs:
|
||||
additional_info["aayush262"]=" Discord: <@918825160654598224>\n AniList: [aayush262](<https://anilist.co/user/aayush262/>)\n"
|
||||
additional_info["rebelonion"]=" Discord: <@714249925248024617>\n AniList: [rebelonion](<https://anilist.co/user/rebelonion/>)\n PornHub: [rebelonion](<https://www.cornhub.com/model/rebelonion>)\n"
|
||||
|
||||
# Extract contributor names from commit log and make unique list
|
||||
# Extract contributor logins from commit log and make unique list
|
||||
committers=$(echo "$COMMIT_LOG" | sed 's/%0A/\n/g' | grep -oP '(?<=~)[^%]*' | sort | uniq)
|
||||
|
||||
# Debugging: Print extracted committers
|
||||
@@ -131,28 +131,28 @@ jobs:
|
||||
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"
|
||||
# Fetch user details first to get the login
|
||||
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"
|
||||
|
||||
# Get commit count for this committer on the dev branch using login
|
||||
commit_count=$(git rev-list --count dev --author="$login")
|
||||
echo "Commit count for $login: $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]}"
|
||||
extra_info="${additional_info[$login]}"
|
||||
if [ -n "$extra_info" ]; then
|
||||
extra_info=$(echo -e "$extra_info" | sed 's/^/- /')
|
||||
echo "Extra info found for $name"
|
||||
echo "Extra info found for $login"
|
||||
else
|
||||
echo "No extra info found for $name"
|
||||
echo "No extra info found for $login"
|
||||
fi
|
||||
|
||||
developers="${developers}◗ **${name}**
|
||||
@@ -169,7 +169,7 @@ jobs:
|
||||
echo "Current developers string:"
|
||||
echo "$developers"
|
||||
else
|
||||
echo "Skipping $committer (no commits on dev branch)"
|
||||
echo "Skipping $login (no commits on dev branch)"
|
||||
fi
|
||||
done < <(echo "$committers")
|
||||
|
||||
@@ -190,12 +190,6 @@ jobs:
|
||||
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" \
|
||||
@@ -204,7 +198,7 @@ jobs:
|
||||
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
|
||||
--arg thumbnail_url "$thumbnail_url" \
|
||||
'{
|
||||
"content": "<@&1209682006376710185>",
|
||||
"content": "<@&1225347048321191996>",
|
||||
"embeds": [
|
||||
{
|
||||
"title": "New Alpha-Build dropped",
|
||||
@@ -233,10 +227,6 @@ jobs:
|
||||
"attachments": []
|
||||
}')
|
||||
|
||||
# Debugging: Print Discord payload
|
||||
echo "Discord payload:"
|
||||
echo "$discord_data"
|
||||
|
||||
# Send Discord message
|
||||
curl -H "Content-Type: application/json" \
|
||||
-d "$discord_data" \
|
||||
|
||||
Reference in New Issue
Block a user