Skip to content

Commit

Permalink
Auto-merge dependabot changes using @nucleos-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Aug 13, 2020
1 parent e65521e commit cc3d192
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @core23
* @core23 @nucleos-bot
52 changes: 51 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,61 @@ jobs:
) && (
(github.actor == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'pedantic'))
)
steps:
- name: "Request review from @nucleos-bot"
uses: "actions/github-script@v2"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
const reviewers = [
"nucleos-bot",
]
await github.pulls.createReviewRequest({
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
reviewers: reviewers,
})
- name: "Assign @nucleos-bot"
uses: "actions/github-script@v2"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
const reviewers = [
"nucleos-bot",
]
await github.issues.addAssignees({
assignees: reviewers,
issue_number: pullRequest.number,
owner: repository.owner,
repo: repository.repo,
})
- name: "Approve pull request"
uses: "actions/github-script@v2"
if: "github.actor != 'nucleos-bot'"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
await github.pulls.createReview({
event: "APPROVE",
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
})
- name: "Merge pull request"
uses: "actions/github-script@v2"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
Expand Down

0 comments on commit cc3d192

Please sign in to comment.