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

Restrict Branch Merge and Automatically Add PR labels to Pull Requests #31

Merged
merged 12 commits into from
Sep 17, 2024
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