Skip to content

Commit

Permalink
ci: Add ChatOps system
Browse files Browse the repository at this point in the history
  • Loading branch information
CycleBai committed Aug 3, 2024
1 parent a44dec1 commit 8ff5624
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/commentcommand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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: Create new branch
run: |
BRANCH_NAME="cba-branch-${{ github.event.issue.number }}-${{ github.run_id }}"
git checkout -b $BRANCH_NAME
echo "New branch created: $BRANCH_NAME"
- name: Push new branch
run: |
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: 'PR From Issue'
body: 'closes #${{ github.event.issue.number }}'
branch: $BRANCH_NAME
base: main

0 comments on commit 8ff5624

Please sign in to comment.