Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
branches: [main, rc-**]
pull_request:
branches: [main]
schedule:
- cron: '0 8 * * 1' # every monday
# Triggered remotely from rstudio/shinycoreci.
workflow_dispatch:

name: Package checks

Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/copilot-pr-review-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Copilot PR review request

on:
pull_request_target:
types: [opened, reopened, ready_for_review]

permissions:
pull-requests: write

jobs:
request-maintainer-review:
if: startsWith(github.event.pull_request.user.login, 'copilot-swe-agent') && !github.event.pull_request.draft
Comment thread
karangattu marked this conversation as resolved.
Outdated
runs-on: ubuntu-latest

steps:
- name: Request maintainer review
shell: bash
env:
GH_TOKEN: ${{ github.token }}
PULL_NUMBER: ${{ github.event.pull_request.number }}
REVIEWER: schloerke
run: |
set -euo pipefail

requested_reviewers="$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${GITHUB_REPOSITORY}/pulls/${PULL_NUMBER}/requested_reviewers" \
--jq '.users[].login' || true)"
Comment thread
karangattu marked this conversation as resolved.
Outdated

if grep -Fxq "${REVIEWER}" <<<"${requested_reviewers}"; then
echo "${REVIEWER} is already a requested reviewer."
exit 0
fi

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${GITHUB_REPOSITORY}/pulls/${PULL_NUMBER}/requested_reviewers" \
--input - <<<"$(jq -n --arg reviewer "${REVIEWER}" '{reviewers: [$reviewer]}')"
Loading