Skip to content

Commit

Permalink
Restrict Branch Merge and Automatically Add PR labels to Pull Requests (
Browse files Browse the repository at this point in the history
  • Loading branch information
AshutoshAJ authored Sep 17, 2024
2 parents fd21b47 + 9657383 commit 5238a21
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ labels: 'enhancement'

---


## 🚀 Feature Request

_A clear and concise description of the feature or improvement you are suggesting._
Expand Down
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
blank_issues_enabled: false

contact_links:
- name: Report Security Vulnerability
url: mailto:srikar@finbox.in
about: Please report security vulnerabilities here.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Share the testing strategy used to ensure the changes work as expected.
- [ ] Tests for the changes have been added
- [ ] CHANGELOG Updated
- [ ] Version number updated
- [ ] Added PR Labels
- [ ] Build is successful
- [ ] Changes do not negatively impact performance
- [ ] New code follows Google Java/Kotlin Style guidelines
Expand Down
7 changes: 7 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
documentation:
- changed-files:
- any-glob-to-any-file: ['.github/*', '**/*.md']

enhancement:
- changed-files:
- any-glob-to-any-file: ['FinBoxRiskManager/*', 'RiskManager/*', 'RiskManagerTests/*']
16 changes: 16 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Pull Request Labeler"
on:
pull_request_target:
types:
- opened # Add labels when PR is created
- synchronize # Add labels when PR receives new commits, which may modify the files in the PR
- reopened # Add labels when PR is opened from closed state

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
16 changes: 16 additions & 0 deletions .github/workflows/restrict-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Enforce Release or Hotfix Branch Merge"

on:
pull_request:
branches:
- main

jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Check if PR is from the release or hotfix branch
if: github.head_ref != 'release' && github.head_ref != 'hotfix'
run: |
echo "Only the release or hotfix branch can be merged into main."
exit 1
16 changes: 16 additions & 0 deletions .github/workflows/restrict-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Enforce Release Branch Merge"

on:
pull_request:
branches:
- release

jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Check if PR is from the develop branch
if: github.head_ref != 'develop'
run: |
echo "Only the develop branch can be merged into release."
exit 1

0 comments on commit 5238a21

Please sign in to comment.