Skip to content

Commit

Permalink
👷 Make issue access check valid
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Mar 26, 2024
1 parent b3fcafe commit 436d129
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/check_issues_access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check issues access

on:
issues:
types: [ opened ]
types: [ opened, reopened, edited ]

jobs:
verify_access:
Expand All @@ -14,18 +14,25 @@ jobs:
id: checkIfUserHasWriteAccess
with:
require: 'write'
- name: Close issues if no access
if: steps.checkIfUserHasWriteAccess.outputs.check-result == false
uses: actions-cool/[email protected]
with:
actions: 'close-issue'
issue-number: ${{ github.event.issue.number }}
- name: Write comment
if: steps.checkIfUserHasWriteAccess.outputs.check-result == false
uses: actions-cool/issues-helper@v2.1.2
if: steps.checkIfUserHasWriteAccess.outputs.check-result == 'false'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }} Infra and blank issues are only available for moderators. You're apperantly using the wrong issue template.
@${{ github.event.issue.user.login }} Infra and blank issues are only available for moderators. You're apparently using the wrong issue template.
> Infra 和空白 issue 仅供管理人员使用,请选择其他 issue 模板创建 issue。
- name: Close issue
if: steps.checkIfUserHasWriteAccess.outputs.check-result == 'false'
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issue'
issue-number: ${{ github.event.issue.number }}
- name: Lock issue
if: steps.checkIfUserHasWriteAccess.outputs.check-result == 'false'
uses: actions-cool/issues-helper@v3
with:
actions: 'lock-issue'
issue-number: ${{ github.event.issue.number }}
lock-reason: 'off-topic'

0 comments on commit 436d129

Please sign in to comment.