Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

73 add workflow to create branch from issue #74

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### Configuration file for ./workflows/create-branch-issue.yml
# Have branches be created when issue is assniged
mode: auto
# Use naming scheme of "issue-[id]"
branchName: short
# Auto-close an issue after the corresponding PR has been merged into `develop`
autoCloseIssue: true
branches:
# Prefix based on issue
- label: model
prefix: model/
- label: bug
prefix: bugfix/
# Skip based on label
- label: duplicate
skip: true
- label: help wanted
skip: true
- label: question
skip: true
- label: invalid
skip: true
- label: wontfix
skip: true
# Open PR to merge `develop` into `release` when issue has label "release"
- label: release
name: develop
prTarget: release
skipBranch: true
# Let PRs labelled "codebase" have branch "yaml" as prTarget and `develop` as source
- label: codebase
name: develop
prTarget: yaml
# Open a Draft PR on issue creation
openDraftPR: true
# Skip CI workflows on empty commits on PR creation (This "Feature" is a GH requirement)
prSkipCI: true
# Copy attributes from issue into PR
copyIssueDescriptionToPR: true
copyIssueLabelsToPR: true
copyIssueAssigneeToPR: true
copyIssueProjectsToPR: true
copyIssueMilestoneToPR: true
# Create "[Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/)" message (See [here](https://github.com/marketplace/actions/create-issue-branch#conventional-pull-request-titles))
conventionalPrTitles: true
# Use semantic versioning with gitmoji
conventionalStyle: semver
33 changes: 33 additions & 0 deletions .github/workflows/create-branch-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
# The issues event below is only needed for the default (auto) mode,
# you can remove it otherwise
issues:
types: [ assigned ]
# The issue_comment event below is only needed for the ChatOps mode,
# you can remove it otherwise
issue_comment:
types: [ created ]
pull_request:
types: [ closed ]

jobs:
create_issue_branch_job:
runs-on: ubuntu-latest
steps:
- name: Create Issue Branch
uses: robvanderleek/create-issue-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: add pr link in comment
uses: mshick/add-pr-comment@master
if: steps.create-issue-branch.outputs.branchName != ''
env:
PULL_REQUEST_URL: ${{ format('https://github.com/{0}/compare/{1}...{2}?quick_pull=1&template={3}', github.repository, github.event.repository.default_branch, steps.create-issue-branch.outputs.branchName, steps.template.outputs.template-name) }}
TEMPLATE: ${{ steps.template.outputs.template-name }}
with:
message: |
## Pull Request ![](https://raw.githubusercontent.com/primer/octicons/master/icons/git-pull-request-16.svg)

[Create a pull request](${{ env.PULL_REQUEST_URL }}) for the issue branch using the `${{ env.TEMPLATE }}` template.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: "github-actions[bot]"
Loading