Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
donggook-me authored Nov 17, 2023
1 parent a8de21c commit 7d7f45b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
for member in "${members[@]}"; do
echo "Fetching commit history for $member..."
# member_commits=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GDSC_GH_TOKEN }}" "https://api.github.com/users/${member}/events")
commits_data=$(echo "$member_commits" | jq -r 'map(select(.type == "PushEvent")) | .[] | {commitId: .payload.commits[0].sha, userName: .payload.commits[0].author.name, commitTime: .created_at, commitMessage: .payload.commits[0].message, commitLink: .payload.commits[0].url }')
member_commits=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GDSC_GH_TOKEN }}" "https://api.github.com/users/${member}/events")
if [[ $(echo "$member_commits" | jq length) -gt 0 ]]; then
# Extracting commit-related data (commit ID, name, time, message, link)
commits_data=$(echo "$member_commits" | jq -r 'map(select(.type == "PushEvent")) | .[].payload.commits[] | {commitId: .sha, userName: .author.name, commitTime: .created_at, commitMessage: .message, commitLink: .url }')
# commits_data=$(echo "$member_commits" | jq -r 'map(select(.type == "PushEvent")) | .[].payload.commits[] | {commitId: .sha, userName: .author.name, commitTime: .created_at, commitMessage: .message, commitLink: .url }')
commits_data=$(echo "$member_commits" | jq -r 'map(select(.type == "PushEvent")) | .[] | {commitId: .payload.commits[0].sha, userName: .payload.commits[0].author.name, commitTime: .created_at, commitMessage: .payload.commits[0].message, commitLink: .payload.commits[0].url }')
# Append the commit data to the member's entry in all_commits
all_commits+=("$member: $commits_data")
Expand Down

0 comments on commit 7d7f45b

Please sign in to comment.