Conversation
Replace the weekly cron schedule with workflow_dispatch to allow manual/remote triggering. Adds a comment indicating the workflow is triggered remotely from rstudio/shinycoreci; existing branch and pull_request triggers remain unchanged.
Add a GitHub Actions workflow that triggers on pull_request_target (opened, reopened, ready_for_review). When a PR is authored by a user whose login starts with 'copilot-swe-agent' and is not a draft, the job uses the GitHub CLI to request reviewer 'schloerke' (after checking if they are already requested). Grants pull-requests: write permission and uses GH_TOKEN for authentication.
There was a problem hiding this comment.
Pull request overview
Updates GitHub Actions automation to streamline maintainer review requests for Copilot-created PRs and to shift package checks away from a fixed weekly schedule toward manual/remote triggering.
Changes:
- Added a
pull_request_targetworkflow to auto-request a maintainer review on certain PR events. - Removed the weekly scheduled trigger from the R CMD check workflow and added
workflow_dispatch.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/copilot-pr-review-request.yaml | New workflow that requests a maintainer review for PRs authored by the Copilot SWE agent. |
| .github/workflows/R-CMD-check.yaml | Removes weekly cron scheduling; keeps PR/push triggers and adds manual dispatch support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| jobs: | ||
| request-maintainer-review: | ||
| if: startsWith(github.event.pull_request.user.login, 'copilot-swe-agent') && !github.event.pull_request.draft |
There was a problem hiding this comment.
The job condition uses startsWith(..., 'copilot-swe-agent'), which would also match any other account whose username begins with that prefix (e.g. copilot-swe-agent-foo). Since this workflow runs on pull_request_target with elevated GITHUB_TOKEN permissions, it should be restricted to an exact allowed actor/login (or a small explicit allow-list) to avoid unintended triggering/spam.
| if: startsWith(github.event.pull_request.user.login, 'copilot-swe-agent') && !github.event.pull_request.draft | |
| if: github.event.pull_request.user.login == 'copilot-swe-agent' && !github.event.pull_request.draft |
| 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)" |
There was a problem hiding this comment.
requested_reviewers swallows any failure from the gh api call (|| true) even though set -euo pipefail is enabled. This can hide real problems (missing permissions, API outage) and lead to confusing behavior (always attempting to request the reviewer). Consider handling errors explicitly (e.g., check exit status and log a clear message, or fail the job) rather than unconditionally ignoring them.
| 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)" | |
| if ! 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')"; then | |
| echo "Failed to fetch requested reviewers for pull request ${PULL_NUMBER}." >&2 | |
| exit 1 | |
| fi |
This pull request updates the GitHub Actions workflows to improve automation around pull request reviews and scheduled checks. The main changes are the addition of a new workflow to automatically request a maintainer review for certain pull requests, and the removal of a scheduled trigger from the R CMD check workflow.
Workflow automation improvements:
copilot-pr-review-request.yaml, which automatically requests a review from the maintainer (schloerke) when a pull request is opened, reopened, or marked ready for review by thecopilot-swe-agentuser, provided the PR is not a draft. This helps streamline the review process for PRs created by the Copilot agent.Changes to scheduled checks:
R-CMD-check.yamlworkflow, so it will no longer run automatically every Monday. The workflow can still be triggered manually or by pull requests and branch updates.