diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4c3d892..c75ed28 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,3 @@ -```markdown ### PR Description @@ -47,4 +46,3 @@ shader PerlinNoise { - [ ] Are all tests passing? -``` diff --git a/.github/workflows/CODEOWNERS b/.github/workflows/CODEOWNERS new file mode 100644 index 0000000..fe342d4 --- /dev/null +++ b/.github/workflows/CODEOWNERS @@ -0,0 +1,7 @@ +* @NripeshN + +crosstl/* @samthakur587 + +tests/* @samthakur587 + +crosstl/* @vaatsalya123 \ No newline at end of file diff --git a/.github/workflows/assign_pull_request.yml b/.github/workflows/assign_pull_request.yml new file mode 100644 index 0000000..51b09d1 --- /dev/null +++ b/.github/workflows/assign_pull_request.yml @@ -0,0 +1,36 @@ +name: Assign PR to Code Owner + +on: + pull_request: + types: [opened] + +jobs: + assign_pr: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up GitHub CLI + run: | + sudo apt-get update + sudo apt-get install gh -y + + - name: Get Code Owners + id: get-code-owners + run: | + CODEOWNERS_FILE=.github/CODEOWNERS + if [ -f "$CODEOWNERS_FILE" ]; then + CODE_OWNER=$(grep -v '^#' $CODEOWNERS_FILE | grep -Eo '@[a-zA-Z0-9_-]+' | head -n 1) + echo "code_owner=${CODE_OWNER#@}" >> $GITHUB_ENV + else + echo "No CODEOWNERS file found." + exit 1 + fi + + - name: Assign PR to Code Owner + if: env.code_owner != '' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr edit ${{ github.event.pull_request.number }} --add-assignee "${{ env.code_owner }}" \ No newline at end of file