This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Pull Request for Current Branch | |
on: | |
push: | |
branches: | |
- '*' # Trigger on any branch | |
jobs: | |
create_pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Get the current branch name | |
- name: Get branch name | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | |
# Create a pull request on the current branch | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Automated Pull Request for changes on ${{ env.branch }}" | |
base: ${{ env.branch }} # Base is the current branch | |
branch: ${{ env.branch }} # Branch is the current branch | |
title: "PR: Review changes on ${{ env.branch }}" | |
body: "This PR is automatically created to review the changes on branch: ${{ env.branch }}." | |
reviewers: "" # Optional: Add reviewers | |
labels: "auto-generated" # Optional: Add labels |