diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 13001f77..5b7e0c1d 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -97,10 +97,64 @@ jobs: ) steps: + - name: "Request review from @ergebnis-bot" + uses: "actions/github-script@v2" + with: + github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" + script: | + const pullRequest = context.payload.pull_request + const repository = context.repo + + const reviewers = [ + "ergebnis-bot", + ] + + await github.pulls.createReviewRequest({ + owner: repository.owner, + pull_number: pullRequest.number, + repo: repository.repo, + reviewers: reviewers, + }) + + - name: "Assign @ergebnis-bot" + uses: "actions/github-script@v2" + with: + github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" + script: | + const pullRequest = context.payload.pull_request + const repository = context.repo + + const reviewers = [ + "ergebnis-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 != 'ergebnis-bot'" + with: + github-token: "${{ secrets.ERGEBNIS_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.ERGEBNIS_BOT_TOKEN }}" script: | const pullRequest = context.payload.pull_request const repository = context.repo diff --git a/.github/workflows/prune.yaml b/.github/workflows/prune.yaml index 9f93aa68..6c923bc1 100644 --- a/.github/workflows/prune.yaml +++ b/.github/workflows/prune.yaml @@ -18,7 +18,7 @@ jobs: with: days-before-close: 5 days-before-stale: 60 - repo-token: "${{ secrets.GITHUB_TOKEN }}" + repo-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" stale-issue-label: "stale" stale-issue-message: | Since this issue has not had any activity within the last sixty days, I have marked it as stale. diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1b0fe494..b233e4a8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ jobs: - name: "Create release" uses: "actions/create-release@v1.1.1" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + ERGEBNIS_BOT_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" with: draft: false prerelease: false diff --git a/.github/workflows/triage.yaml b/.github/workflows/triage.yaml index 1790b817..f8afb6d0 100644 --- a/.github/workflows/triage.yaml +++ b/.github/workflows/triage.yaml @@ -17,7 +17,7 @@ jobs: - name: "Add labels based on branch name" uses: "actions/github-script@v2" with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" script: | const branchPrefixLabels = { feature: "enhancement",