mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 17:28:57 +00:00
Add workflow to lock spam issues
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
name: Close and lock spam issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
handle_spam:
|
||||
if: github.event.label.name == 'spam'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Close the issue
|
||||
run: gh issue close "$ISSUE_NUM" --reason "not planned"
|
||||
- name: Lock the issue
|
||||
run: |
|
||||
if [ "$(gh api repos/"$GH_REPO"/issues/"$ISSUE_NUM" --jq '.locked')" = "false" ]; then
|
||||
gh issue lock "$ISSUE_NUM" --reason "spam"
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
ISSUE_NUM: ${{ github.event.issue.number }}
|
||||
Reference in New Issue
Block a user