Workflow file for this run
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 PR Creation and Merge | |
on: | |
push: | |
branches-ignore: | |
- main # Trigger on push to any branch except main | |
jobs: | |
create-and-merge-pr: | |
# Only run for pushes from krishkumar84 | |
if: github.actor == 'krishkumar84' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Needed for creating PR | |
- name: Create Pull Request | |
id: create-pr | |
run: gh pr create -B base_branch -H branch_to_merge --title 'Merge branch_to_merge into base_branch' --body 'Created by Github action' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print PR URL | |
if: success() | |
run: | | |
echo "Created PR: ${{ steps.create-pr.outputs.pull-request-url }}" |