Skip to content

Commit 06a5658

Browse files
Update dependabot-merger.yml
1 parent 2f39901 commit 06a5658

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/dependabot-merger.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff 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: |
@@ -68,7 +69,7 @@ jobs:
6869
- name: Post to a Slack channel
6970
uses: slackapi/[email protected]
7071
with:
71-
channel-id: 'C03RTLRKJQP'
72+
channel-id: 'C04E69NEDAT'
7273
payload: |
7374
{
7475
"blocks": [

0 commit comments

Comments
 (0)