|
64 | 64 | echo "Contributor $contributor has $issue_count open issues. Please complete your existing open issues before creating a new one."
|
65 | 65 | exit 1
|
66 | 66 | fi
|
67 |
| -
|
68 |
| -# name: PR Creation Workflow |
69 |
| - |
70 |
| -# on: |
71 |
| -# pull_request: |
72 |
| -# types: [opened, edited] |
73 |
| - |
74 |
| -# jobs: |
75 |
| -# check-pr: |
76 |
| -# runs-on: ubuntu-latest |
77 |
| - |
78 |
| -# steps: |
79 |
| -# - name: Checkout repository |
80 |
| -# uses: actions/checkout@v4 |
81 |
| - |
82 |
| -# - name: Set up Node.js |
83 |
| -# uses: actions/setup-node@v4 |
84 |
| -# with: |
85 |
| -# node-version: '14' |
86 |
| - |
87 |
| -# - name: Validate PR Description |
88 |
| -# id: validate-pr |
89 |
| -# run: | |
90 |
| -# pr_body="${{ github.event.pull_request.body }}" |
91 |
| -# required_checkboxes=( |
92 |
| -# "I have performed a self-review of my code." |
93 |
| -# "I have read and followed the Contribution Guidelines." |
94 |
| -# "I have tested the changes thoroughly before submitting this pull request." |
95 |
| -# "I have provided relevant issue numbers, screenshots, and videos after making the changes." |
96 |
| -# "I have commented my code, particularly in hard-to-understand areas." |
97 |
| -# "I have followed the code style guidelines of this project." |
98 |
| -# "I have checked for any existing open issues that my pull request may address." |
99 |
| -# "I have ensured that my changes do not break any existing functionality." |
100 |
| -# "Each contributor is allowed to create a maximum of 4 issues per day. This helps us manage and address issues efficiently." |
101 |
| -# "I have read the resources for guidance listed below." |
102 |
| -# "I have not used AI-generated content (e.g., ChatGPT, other AI tools)." |
103 |
| -# "I have not used content from existing sites (e.g., text, images)." |
104 |
| -# "I have followed all security rules and only shared trusted resources." |
105 |
| -# ) |
106 |
| -# for checkbox in "${required_checkboxes[@]}"; do |
107 |
| -# if [[ "$pr_body" != *"$checkbox"* ]]; then |
108 |
| -# echo "Missing required checkbox: $checkbox" |
109 |
| -# exit 1 |
110 |
| -# fi |
111 |
| -# done |
112 |
| - |
113 |
| -# - name: Retrieve Contributors |
114 |
| -# id: retrieve-contributors |
115 |
| -# run: | |
116 |
| -# CONTRIBUTORS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/contributors | jq -r '.[].login') |
117 |
| -# echo "contributors=$CONTRIBUTORS" >> $GITHUB_ENV |
118 |
| - |
119 |
| -# - name: Count Open Issues for Each Contributor |
120 |
| -# id: count-issues |
121 |
| -# run: | |
122 |
| -# for contributor in ${{ env.contributors }}; do |
123 |
| -# ISSUE_COUNT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=is:open+author:${contributor}+repo:${{ github.repository }}" | jq -r '.total_count') |
124 |
| -# echo "${contributor}_issue_count=$ISSUE_COUNT" >> $GITHUB_ENV |
125 |
| -# done |
126 |
| - |
127 |
| -# - name: Check Contributor's Open Issues Count |
128 |
| -# run: | |
129 |
| -# contributor=${{ github.event.pull_request.user.login }} |
130 |
| -# issue_count=$(printenv | grep "${contributor}_issue_count" | cut -d '=' -f2) |
131 |
| -# if [ "$issue_count" -ge 4 ]; then |
132 |
| -# echo "Contributor $contributor has $issue_count open issues. Please complete your existing open issues before creating a new one." |
133 |
| -# exit 1 |
134 |
| -# fi |
0 commit comments