Skip to content

Commit

Permalink
fix: cleanup by extracting pr title and body
Browse files Browse the repository at this point in the history
  • Loading branch information
botanical committed Dec 19, 2024
1 parent c6dfa31 commit 795a031
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,18 @@ jobs:
# Convert the comma-separated list into bullet points
collection_bullet_points=""
IFS=',' read -ra IDs <<< "$collection_ids"
# Extract the first collection ID
first_collection_id="${IDs[0]}"
for id in "${IDs[@]}"; do
collection_bullet_points+="- $id\n"
done
body="### Add dataset(s) - [Automated PR by ${{ github.actor }}]\n $collection_bullet_points\n"
pr_title="Add dataset(s) - $first_collection_id [Automated PR by ${{ github.actor }}]"
body="### Add dataset(s) - $first_collection_id [Automated PR by ${{ github.actor }}]\n\n$collection_bullet_points"
echo "$body"
PR_URL=$(GITHUB_TOKEN=${{ secrets.VEDA_CONFIG_REPO_ACCESS_TOKEN }} gh pr create -R ${{ env.VEDA_CONFIG_REPO }} -H $NEW_BRANCH -B develop --title "Add dataset(s) $(echo '${{ env.collection_ids }}' | jq '.[0]') [Automated PR by ${{ github.actor }}]" --body "$body")
PR_URL=$(GITHUB_TOKEN=${{ secrets.VEDA_CONFIG_REPO_ACCESS_TOKEN }} gh pr create -R ${{ env.VEDA_CONFIG_REPO }} -H $NEW_BRANCH -B develop --title "$pr_title" --body "$body")
echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT
echo "PR creation succeeded!"
Expand Down

0 comments on commit 795a031

Please sign in to comment.