· Research & technology· 日本語で読む
GitHub Introduces Example Setup for Daily Automated PRs Using Copilot
A blog post on GitHub introduced a workflow example that creates a branch and pull request (PR) each day. It showed scheduled runs with GitHub Actions and an example of having Copilot Coding Agent work from an issue. The post also presented automatic merging as an option, while calling for branch protection rules and required checks.
Key facts
- The Actions example runs every day at 9 a.m. UTC and creates a branch named `feature/auto-pr-YYYYMMDD`.
- The workflow example sets the `contents: write` and `pull-requests: write` permissions.
- The post shows an example that uses `peter-evans/create-pull-request@v6` to create a PR.
- The automatic merge example uses `gh pr merge --auto --squash` and calls for branch protection rules and required status checks.
What happened
A blog post on GitHub introduced an example setup for automatically creating PRs by combining GitHub Actions and GitHub Copilot. In the example, a branch named `feature/auto-pr-YYYYMMDD` is created every day at 9 a.m. UTC, followed by content generation, a commit and PR creation. The post also showed a separate example in which Copilot Coding Agent starts from an issue and creates a branch and PR.
Why it matters
The examples show how a workflow can separate the step of presenting generated output as a PR from the step of automatically merging changes that pass checks. For tasks such as daily content additions or dependency updates, branch protection rules and required status checks provide specific controls for allowing automated changes to reach `main`.
Analysis
The post focuses less on code generation by Copilot itself than on operational design that connects scheduled runs to PR submission. The Actions example describes a sequence of steps: running every day at 9 a.m. UTC, creating a date-named branch, running a content-generation script, committing the changes and creating a PR. By contrast, the example that assigns work to Copilot Coding Agent from an issue is triggered by a request rather than a schedule, and proceeds from repository analysis to PR creation. The post presents these as two examples; they are not integrated into the same implementation.
In a related article, we outlined how to automate GitHub Copilot CLI with GitHub Actions. That article covers how to run the CLI noninteractively within a workflow and recommends Agentic Workflows for certain use cases. The blog post covered here does not show how to run the CLI; it presents an example of using Actions for daily content generation and PR creation, as well as an example of having Copilot Coding Agent handle an issue. The two should not be conflated: teams need to define the boundary between work delegated to an agent and work handled by a set script.
A key aspect of the setup is that generated output is not applied directly to `main`; instead, the PR serves as a handoff point for review. Automatic merging is also shown as an option, but the post itself says branch protection rules and required status checks should be in place. Automation therefore needs to account not only for generation but also for checks that can block changes and the conditions for approval. The post does not specify the particular checks to run or how to assess the quality of generated output.
The examples of skipping a run if a branch for the same date already exists and creating an issue when a run fails are components for handling duplicate scheduled runs and failures. However, the post provides configuration examples, not results from actual deployments, such as success rates, review workloads or the frequency of erroneous output. When evaluating adoption, key considerations include how to check each type of generated output, how to retry after failures, how narrowly permissions can be scoped and under what conditions automatic merging is acceptable.
Details
The Actions example uses `ubuntu-latest` as the runner and sets the `contents: write` and `pull-requests: write` permissions. It checks out the repository with `actions/checkout@v4` and retrieves the date in `YYYYMMDD` format for the branch name. For PR creation, it uses `peter-evans/create-pull-request@v6`; the post also includes a shell example that skips processing if a branch for the same date already exists.
The post also includes an example of automatic PR merging with `gh pr merge --auto --squash` and an example of creating an issue on failure with `actions/github-script@v7`. It advises setting appropriate branch protection rules and required status checks when enabling automatic merging.
Sources
Translated from the Japanese original: /news/github-copilot-wo-tsukatta-nichiji-jidou-pr-no-kousei-rei-wo-a7eeb9. The Japanese version is authoritative if they differ.