Automate the creation of co-authored pull requests using GitHub Actions to unlock the Pair Extraordinaire GitHub achievement.
This repository contains a workflow that automatically:
- Creates commits with two authors
- Opens pull requests into
main - Squash merges them
- Deletes the branch
- Repeats the process multiple times
The workflow is designed to help demonstrate co‑authored collaboration activity using GitHub automation.
The workflow generates a sequence of pull requests where each commit includes:
- a primary author
- a co-author using the
Co-authored-by:commit trailer
GitHub recognizes these commits as collaborative contributions.
When merged, they count toward the Pair Extraordinaire achievement.
When the workflow runs, it performs the following steps:
- Checks out the
mainbranch with full history - Installs the GitHub CLI (
gh) - Authenticates using a Personal Access Token
- Ensures a placeholder file
.envexampleexists - Loops through multiple iterations
- Creates a commit authored by one user
- Adds a
Co-authored-by:trailer for the second user - Pushes the branch
- Creates a pull request
- Squash merges the PR
- Deletes the branch
- Repeats the process
Each iteration updates .envexample to guarantee a real file change.
Before running this workflow:
- GitHub Actions must be enabled
- Your repository must have a
mainbranch - The token must have permission to push and merge PRs
- Branch protection rules must allow the workflow to merge
This workflow should be used in a repository you control.
Create the file:
.github/workflows/pair-extraordinaire.yml
Paste the workflow contents into that file.
Create a GitHub Personal Access Token that allows:
- repository read/write
- pull request creation
- pull request merging
Typical permission scope:
repo
In your repository:
- Open Settings
- Navigate to Secrets and Variables
- Click Actions
- Create a secret named:
<!-- -->
PERSONAL_ACCESS_TOKEN
Paste the token value.
This workflow is triggered manually.
Steps:
- Open the Actions tab in your repository
- Select Automate Pair Extraordinaire Badge
- Click Run workflow
The workflow will then automatically generate and merge the configured number of co-authored pull requests.
Inside the workflow you will see configuration values such as:
COAUTHOR_NAME
COAUTHOR_EMAIL
PRIMARY_NAME
PRIMARY_EMAIL
These values define the two collaborators.
Example:
COAUTHOR_NAME: DongwanXu
COAUTHOR_EMAIL: dongwanxu23@gmail.com
PRIMARY_NAME: chrisbanas
PRIMARY_EMAIL: bananas595@gmail.com
Both emails must be verified emails on the respective GitHub accounts.
Otherwise GitHub will not recognize the co-author.
Each commit uses the format:
Author: DongwanXu
Co-authored-by: chrisbanas
GitHub parses the trailer:
Co-authored-by: Name <email>
This is how the contribution is attributed to both accounts.
Each iteration appends a line to:
.envexample
Example:
BADGE_RUN_12=1712345678
This guarantees that each PR contains a real commit.
The workflow runs approximately 48--49 pull request cycles.
This number can be adjusted inside the script if desired.
Example loop:
for i in $(seq 1 49)
The workflow includes a short delay between merges:
sleep 1
This helps prevent GitHub API rate limits.
If you encounter limits, increasing this delay may help.
Temporary branches are created like:
badge-run-1
badge-run-2
badge-run-3
These are deleted automatically after merging.
Best practices:
- never store tokens directly in the workflow file
- always use repository secrets
- use minimal token permissions
- test in a personal repository first
If this project is public:
- commit history will show automated PR activity
- collaborators will appear in commit authorship
- the workflow logic will be visible
Never expose your personal access token.
Before running a full batch, you may want to reduce the loop count:
seq 1 3
This allows you to verify:
- authentication works
- commits are created correctly
- PR creation works
- merging works
- branch deletion works
Once confirmed, increase the count.
Use this workflow responsibly and only in repositories you control or have permission to automate.
You are responsible for complying with GitHub's platform policies and repository rules.