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 20, 2023
1 parent 5c84081 commit 82e78aa
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 @@ -44,20 +44,20 @@ jobs:
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")) | .[] | {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")
all_commits+=("$commits_data")
else
echo "No new commit data for $member."
fi
done
if [[ ${#all_commits[@]} -gt 0 ]]; then
# Save the commits data to data.json
sorted_commits=$(echo "${all_commits[@]}" | jq -s .)
mkdir -p data
echo "{ ${all_commits[@]} }" > data/data.json
echo "$sorted_commits" > data/data.json
else
echo "No new commit data for any member." > data/empty_commit_data.txt
fi
Expand Down

0 comments on commit 82e78aa

Please sign in to comment.