generated from ergebnis/php-package-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #348 from Lctrs/fix/merge
gha: restore auto-merge of dependabot pull requests
- Loading branch information
Showing
5 changed files
with
98 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# https://docs.github.com/en/actions | ||
|
||
name: "Merge" | ||
|
||
on: # yamllint disable-line rule:truthy | ||
workflow_run: | ||
types: | ||
- "completed" | ||
workflows: | ||
- "Integrate" | ||
|
||
jobs: | ||
merge: | ||
name: "Merge" | ||
|
||
runs-on: "ubuntu-20.04" | ||
|
||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' && | ||
github.actor == 'dependabot[bot]' && ( | ||
startsWith(github.event.workflow_run.head_commit.message, 'composer(deps-dev)') || | ||
startsWith(github.event.workflow_run.head_commit.message, 'tools(deps)') || | ||
startsWith(github.event.workflow_run.head_commit.message, 'github-actions(deps)') | ||
) | ||
steps: | ||
|
||
- name: "Request review from @lctrs-bot" | ||
uses: "actions/github-script@v4.0.2" | ||
with: | ||
github-token: "${{ secrets.LCTRS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.workflow_run.pull_requests[0] | ||
const repository = context.repo | ||
const reviewers = [ | ||
"lctrs-bot", | ||
] | ||
await github.pulls.requestReviewers({ | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
pull_number: pullRequest.number, | ||
reviewers: reviewers, | ||
}) | ||
- name: "Assign @lctrs-bot" | ||
uses: "actions/github-script@v4.0.2" | ||
with: | ||
github-token: "${{ secrets.LCTRS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.workflow_run.pull_requests[0] | ||
const repository = context.repo | ||
const assignees = [ | ||
"lctrs-bot", | ||
] | ||
await github.issues.addAssignees({ | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
assignees: assignees, | ||
issue_number: pullRequest.number | ||
}) | ||
- name: "Approve pull request" | ||
uses: "actions/github-script@v4.0.2" | ||
with: | ||
github-token: "${{ secrets.LCTRS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.workflow_run.pull_requests[0] | ||
const repository = context.repo | ||
await github.pulls.createReview({ | ||
event: "APPROVE", | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
pull_number: pullRequest.number, | ||
}) | ||
- name: "Merge pull request" | ||
uses: "actions/github-script@v4.0.2" | ||
with: | ||
github-token: "${{ secrets.LCTRS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.workflow_run.pull_requests[0] | ||
const repository = context.repo | ||
await github.pulls.merge({ | ||
merge_method: "merge", | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
}) |