QiliangFan opened a new pull request #12241:
URL: https://github.com/apache/shardingsphere/pull/12241


   Fixes #9697.
   
   Changes proposed in this pull request:
   - `Rerun CI` when comment `/run ci` 
   - Remove `status: inactive` tag when the corresponding issue is reopened, 
edited or commented.
   - Close issues without reply for fifteen days
   - Close issues with tag `status: inactive`
   
   :eyes: We only need to pay attention to the file: 
`.github/workflows/issue.yml` 
   
   # :cactus: `Rerun CI` when comment `/run ci` 
   
   ```yaml
     comment-action:
       runs-on: ubuntu-latest
       if: ${{ github.event_name == 'issue_comment' }}
       steps:
         - name: Print Issue Comment
           run: |
             echo ${{ github.event.comment.body }}
   
         - name: Trigger The CI Workflow
           if: ${{ contains( github.event.comment.body , '/run ci') }} 
           uses: mvasigh/dispatch-action@main
           with:
             token: ${{ secrets.PERSONAL_TOKEN }}
             repo: shardingsphere
             owner: ${{ github.actor }}
             event_type: rerun-ci
   ```
   
   Test result: 
[here](https://github.com/QiliangFan/shardingsphere/actions/runs/1205832417) | 
[CI triggered by github 
actions](https://github.com/QiliangFan/shardingsphere/actions/runs/1205832785)
   
   
   
   # :happy: Remove `status: inactive` tag when the corresponding issue is 
reopened, edited or commented.
   
   ```yaml
     remove-inactive:
       runs-on: ubuntu-latest
       if: ${{ github.event_name == 'issue_comment' || ( github.event_name == 
'issues' && ( github.event.action == 'edited' || github.event.action == 
'reopened' ) ) }}
       steps:
       - name: Remove "status:inactive" label
         if: ${{ contains( github.event.issue.labels.*.name , format('status{0} 
inactive', ':') ) }}
         uses: actions-cool/[email protected]
         with:
           actions: 'remove-labels'
           token: ${{ secrets.GITHUB_TOKEN }}
           issue-number: ${{ github.event.issue.number }}
           labels: "status: inactive"
   ```
   
   Test result: 
[here](https://github.com/QiliangFan/shardingsphere/actions/runs/1205862858)
   
   
   
   # :closed_lock_with_key:  Close issues without reply for fifteen days
   
   ```yaml
     check-inactive-issue:
       runs-on: ubuntu-latest
       concurrency: check-inactive  # singleton-run-stage
       if: ${{ github.event_name == 'schedule' }}
       steps:
         - name: check-inactive   # add `status: inactive` label
           uses: actions-cool/[email protected] 
           with: 
             actions: 'check-inactive' 
             token: ${{ secrets.GITHUB_TOKEN }} 
             inactive-day: 15
             inactive-label: "status: inactive"
             body: |
               Hello ${{ github.event.issue.user.login }}, this issue has not 
received a reply for serveral days.
               This issue is supposed to be closed.
             contents: "heart"
   ```
   
   
   
   # :mask: Close issues with tag `status: inactive`
   
   ```yaml
     close-issue:
       runs-on: ubuntu-latest
       concurrency:    # singleton-run-stage
         group: close-issue
         cancel-in-progress: true
       if: ${{ github.event_name == 'schedule' || ( github.event_name == 
'issues' && github.event.action == 'labeled' ) }}
       steps:
         - name: Close Issue   # close issues with `labels`
           uses: actions-cool/[email protected]
           with:
             actions: 'close-issues'
             token: ${{ secrets.GITHUB_TOKEN }}
             labels: 'status: inactive'
   ```
   
   Test result: 
[here](https://github.com/QiliangFan/shardingsphere/actions/runs/1205828460)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to