Skip to content
name: New Issue Comment
on:
issue_comment:
types: [created]
jobs:
create-branch-and-pr:
if: contains(github.event.comment.body, '/cba')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Set branch name
run: |
BRANCH_NAME="cba-branch-${{ github.event.issue.number }}-${{ github.run_id }}"
- name: Create new branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: 'release-notes'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: 'Merge branch $BRANCH_NAME into main'
body: 'This PR is created from a comment on issue #${{ github.event.issue.number }}'
branch: $BRANCH_NAME
base: main