Skip to content

Commit

Permalink
fix: adjust failed issue-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Caknoooo committed Oct 3, 2023
1 parent 03904af commit 37476cf
Showing 1 changed file with 2 additions and 49 deletions.
51 changes: 2 additions & 49 deletions .github/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,2 @@
# branchName: "is-${issue.number}-${issue.title}"
# commentMessage: "Branch ${branchName} created for issue: ${issue.title}"

name: Create Issue Branch

on:
issues:
types:
- opened

jobs:
create-branch:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Get Issue Title and Number
id: issue-info
run: |
echo "::set-output name=issue_title::${{ github.event.issue.title }}"
echo "::set-output name=issue_number::${{ github.event.issue.number }}"
- name: Create Branch
run: |
issue_title="${{ steps.issue-info.outputs.issue_title }}"
issue_number="${{ steps.issue-info.outputs.issue_number }}"
branch_name=""
if [[ $issue_title == *"fix"* ]]; then
branch_name="bugfix/is-${issue_number}-${issue_title}"
elif [[ $issue_title == *"feature"* ]]; then
branch_name="feature/is-${issue_number}-${issue_title}"
else
branch_name="is-${issue_number}-${issue_title}"
fi
git checkout -b "$branch_name"
echo "Branch $branch_name created for issue: $issue_title"
- name: Push Branch
run: |
git push origin "$branch_name"
branchName: "is-${issue.number}-${issue.title}"
commentMessage: "Branch ${branchName} created for issue: ${issue.title}"

0 comments on commit 37476cf

Please sign in to comment.