Skip to content

Commit

Permalink
Update dependabot-merger.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nsingh-branch committed Sep 20, 2023
1 parent fa70c0c commit 9b3727c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/dependabot-merger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
uses: actions/github-script@v6
id: create-pr
with:
github-token: ${{secrets.DEPENDABOT_MERGER_PAT}}
script: |
const pulls = await github.paginate('GET /repos/:owner/:repo/pulls', {
owner: context.repo.owner,
Expand All @@ -25,18 +24,16 @@ jobs:
let baseBranchSHA = null;
for (const pull of pulls) {
const branch = pull['head']['ref'];
console.log('Pull for branch: ' + branch);
if (branch.startsWith('dependabot/')) {
console.log('Branch matched prefix: ' + branch);
console.log('Adding branch to array: ' + branch);
console.log('Branch matched prefix. Adding to array: ' + branch);
const prString = '#' + pull['number'] + ' ' + pull['title'];
branchesAndPRStrings.push({ branch, prString });
baseBranch = pull['base']['ref'];
baseBranchSHA = pull['base']['sha'];
}
}
if (branchesAndPRStrings.length == 0) {
core.setFailed('No PRs/branches matched criteria');
core.setFailed('There are no open dependabot PRs.');
return;
}
try {
Expand All @@ -48,7 +45,7 @@ jobs:
});
} catch (error) {
console.log(error);
core.setFailed('Failed to create combined branch - maybe a branch by that name already exists?');
core.setFailed('Failed to create combined branch');
return;
}
Expand Down Expand Up @@ -109,7 +106,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Included PRs:*${{ steps.create-pr.outputs.pr_body }}"
"text": "*Included PRs:*\n${{ steps.create-pr.outputs.pr_body }}"
}
},
{
Expand Down

0 comments on commit 9b3727c

Please sign in to comment.