Created
November 10, 2023 06:28
-
-
Save lohanidamodar/54053e039c846e4b153234346e68c33a to your computer and use it in GitHub Desktop.
Create new branch and PR for issue
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: Handle Issues | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
create-branch-and-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create new branch | |
run: | | |
git config --global user.email "your-email@example.com" | |
git config --global user.name "Your Name" | |
git checkout -b issue-${{ github.event.issue.number }} | |
- name: Add template files | |
run: | | |
git pull origin main | |
cp path/to/your/template1 path/to/destination/template1 | |
cp path/to/your/template2 path/to/destination/template2 | |
git add . | |
git commit -m "Add template files for issue #${{ github.event.issue.number }}" | |
git push origin issue-${{ github.event.issue.number }} | |
- name: Create pull request | |
uses: repo-sync/pull-request@v2 | |
with: | |
destination_branch: "main" | |
pr_title: "Pull Request for issue #${{ github.event.issue.number }}" | |
pr_body: "This pull request addresses the issue #${{ github.event.issue.number }}" | |
github_token: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment