Priority Management System #4608
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Priority Management System | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize] | |
| issues: | |
| types: [opened, edited] | |
| schedule: | |
| # ๆฏๅฐๆๆชขๆฅไธๆฌกๅพ ่็็ PR ๅ Issue | |
| - cron: '0 * * * *' | |
| workflow_dispatch: # ๅ ่จฑๆๅ่งธ็ผ | |
| jobs: | |
| priority-management: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.8' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests | |
| - name: Set up environment variables | |
| run: | | |
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
| echo "REPO_OWNER=BabyGrootCICD" >> $GITHUB_ENV | |
| echo "REPO_NAME=Sext-Adventure" >> $GITHUB_ENV | |
| - name: Run priority management | |
| run: | | |
| python scripts/priority_manager.py | |
| - name: Create priority summary | |
| if: always() | |
| run: | | |
| echo "## ๐ฏ ๅชๅ ็ด็ฎก็ๆ่ฆ" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### โ ๅท่ก็ตๆ" >> $GITHUB_STEP_SUMMARY | |
| echo "- ๐ ๅทฒๆชขๆฅๆๆๅพ ่็็ PR ๅ Issue" >> $GITHUB_STEP_SUMMARY | |
| echo "- ๐ท๏ธ ๅทฒ่ชๅๆทปๅ ๅชๅ ็ดๆจ็ฑค" >> $GITHUB_STEP_SUMMARY | |
| echo "- ๐ฅ ๅทฒ่ชๅๅ้ ๅฏฉๆฅ่ ๅ่็่ " >> $GITHUB_STEP_SUMMARY | |
| echo "- ๐ฌ ๅทฒๆทปๅ ๅชๅ ็ด่ชชๆ่ฉ่ซ" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### ๐ ไธๆฌกๆชขๆฅ" >> $GITHUB_STEP_SUMMARY | |
| echo "ไธๆฌก่ชๅๆชขๆฅๆ้๏ผ1 ๅฐๆๅพ" >> $GITHUB_STEP_SUMMARY | |
| branch-access-management: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.8' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests | |
| - name: Set up environment variables | |
| run: | | |
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
| echo "REPO_OWNER=BabyGrootCICD" >> $GITHUB_ENV | |
| echo "REPO_NAME=Sext-Adventure" >> $GITHUB_ENV | |
| - name: Run branch access management | |
| run: | | |
| python scripts/branch_access_manager.py | |
| - name: Check for changes | |
| id: check-changes | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "has-changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has-changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.check-changes.outputs.has-changes == 'true' | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add branch_access_report_*.md | |
| git commit -m "๐ค Auto-update: ๅๆฏๅญๅๆฌ้ๅ ฑๅ | |
| - ๆดๆฐๅๆฏๅญๅๆฌ้้ ็ฝฎ | |
| - ็ๆๅญๅๆฌ้ๅ ฑๅ | |
| - ๅๆญฅ่ฒข็ป่ ็ญ็ด | |
| [skip ci]" || exit 0 | |
| git push | |
| - name: Create branch access summary | |
| if: always() | |
| run: | | |
| echo "## ๐ ๅๆฏๅญๅ็ฎก็ๆ่ฆ" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### โ ๅท่ก็ตๆ" >> $GITHUB_STEP_SUMMARY | |
| if [ -f "branch_access_report_*.md" ]; then | |
| echo "- ๐ ๅๆฏๅญๅๆฌ้ๅ ฑๅๅทฒ็ๆ" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "- ๐ ๅทฒๆชขๆฅๆๆ่ฒข็ป่ ็ๅญๅๆฌ้" >> $GITHUB_STEP_SUMMARY | |
| echo "- ๐ท๏ธ ๅทฒๆดๆฐๅๆฏไฟ่ญท่ฆๅ" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### ๐ ไธๆฌกๆดๆฐ" >> $GITHUB_STEP_SUMMARY | |
| echo "ไธๆฌก่ชๅๆดๆฐๆ้๏ผๆฏๆฅ 00:00 UTC" >> $GITHUB_STEP_SUMMARY |