File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -45,20 +45,21 @@ jobs:
4545 echo "$PR_COUNT PR's to be merged: $PR_LIST"
4646
4747 - name : Merge PRs into new branch
48- id : merge_prs
4948 run : |
5049 NEW_BRANCH="dependabot-test-${{ steps.datetime.outputs.date }}"
5150 git checkout $NEW_BRANCH
52- IFS=$'\n' read -r -a array <<< "${{ steps.pr_list.outputs.numbers }}"
53- for item in "${array[@]}"; do
54- IFS=' ' read -r PR_NUMBER BRANCH_NAME <<< "$item"
51+ PR_LIST=$(gh pr list --json number,headRefName --jq '.[] | "\(.number) \(.headRefName)"' | grep dependabot)
52+ PR_LIST=$(echo "$PR_LIST" | tr -d '\r') # Remove trailing newline
53+ echo "::set-output name=numbers::$PR_LIST"
54+ while IFS= read -r line; do
55+ IFS=' ' read -r PR_NUMBER BRANCH_NAME <<< "$line"
5556 echo "Merging PR #$PR_NUMBER from branch $BRANCH_NAME into $NEW_BRANCH..."
5657 git fetch origin $BRANCH_NAME
5758 git merge --no-commit --allow-unrelated-histories --strategy-option=theirs origin/$BRANCH_NAME
5859 echo "Pushing changes to $NEW_BRANCH..."
5960 git commit -m "Merged PR #$PR_NUMBER into $NEW_BRANCH"
6061 git push origin $NEW_BRANCH
61- done
62+ done <<< "$PR_LIST"
6263
6364 - name : Merge process status
6465 run : |
6869 - name : Post to a Slack channel
69707071 with :
71- channel-id : ' C03RTLRKJQP '
72+ channel-id : ' C04E69NEDAT '
7273 payload : |
7374 {
7475 "blocks": [
You can’t perform that action at this time.
0 commit comments