Skip to content

Commit

Permalink
Cleaned add-playlist-workflow.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark-Kernel authored Nov 24, 2024
1 parent 21d4182 commit cfbadf6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/add-playlist-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ jobs:
EVENT_ID: ${{ github.event.issue.number }}
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
echo "eventid: $EVENT_ID, Github context: cool"
BODY="$ISSUE_BODY"
echo "body ===> $BODY"
PLAYLIST_TITLE=$(echo "$BODY" | grep "### Playlist Title" -A 2 | tail -n 1)
PLAYLIST_URL=$(echo "$BODY" | grep "### YouTube Playlist URL" -A 2 | tail -n 1)
PLAYLIST_SUMMARY=$(echo "$BODY" | grep "### Playlist Summary" -A 2 | tail -n 1)
Expand All @@ -61,9 +59,7 @@ jobs:
# # Set outputs
# echo "creator=$CREATOR" >> $GITHUB_OUTPUT
# echo "playlist_title=$PLAYLIST_TITLE" >> $GITHUB_OUTPUT
# # Extract JSON from issue body
# Run the verify_playlist.py script
# Verify the playlist
python .github/scripts/verify_playlist.py temp_playlist.json
if [[ $? -ne 0 ]]; then
Expand All @@ -80,10 +76,8 @@ jobs:
exit 1
fi
# Create a new branch
issue_number=$EVENT_ID
echo "eventid====> $EVENT_ID"
branch_name="contribution-$issue_number"
git checkout -b "$branch_name"
git add playlist.json
Expand All @@ -95,7 +89,7 @@ jobs:
# Create a pull request
pr_url="https://api.github.com/repos/${{github.repository}}/pulls"
pr_data=$(jq -n --arg title "Contribution from issue #$issue_number" \
--arg body "This PR adds the contribution from issue #$issue_number with\n $(<temp_playlist.json)" \
--arg body "$(printf "### Description\n\nThis PR adds the contribution from issue #$issue_number.\n\n#### Playlist Details:\n\`\`\`json\n%s\n\`\`\`" "$(cat temp_playlist.json)")" \
--arg head "$branch_name" \
--arg base "main" \
'{title: $title, body: $body, head: $head, base: $base}')
Expand Down

0 comments on commit cfbadf6

Please sign in to comment.