Skip to content

Unable to use itemsadder on version 1.21.3 #905

Unable to use itemsadder on version 1.21.3

Unable to use itemsadder on version 1.21.3 #905

# This is a GitHub Action Workflow designed to execute specific actions based on specific comments.
# As of right now is this Workflow supporting the following:
# - Close issues and label them as "type: duplicate" when owner/member/collaborator writes "Duplicate of"
name: Issue Comment Actions
on:
issue_comment:
types: [created]
# Ensures that only one action runs per issue, preventing possible race-conditions or smth.
# Any other action for the same issue should be put in queue, waiting for the active one to finish.
concurrency:
group: ${{ github.event.issue.number }}
cancel-in-progress: false
jobs:
close_issue:
runs-on: ubuntu-latest
permissions:
issues: write
# Check that the comment is on an issue, contains "Duplicate of" and that author is owner, member or collaborator.
if: |-
${{
!github.event.issue.pull_request &&
github.event.issue.state == 'open' &&
contains(github.event.comment.body, 'Duplicate of') &&
(github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
}}
steps:
# Add "type: duplicate" label
- name: Update Issue Labels
run: 'gh issue edit $NUMBER --add-label "type: duplicate" --remove-label "$(gh issue view $NUMBER --json labels --jq ''.labels | map(.name) | join(",")'')"'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
# Close issue as "Not Planned"
- name: Close issue
run: 'gh issue close "$NUMBER" --reason "not planned"'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
- name: Update Comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
comment-id: ${{ github.event.comment.id }}
body: |-
<!-- Bot comment Start -->
----
Your issue has been marked as **duplicate**!
Please always check the issue tracker first for any existing issues of the same problem/suggestion (including closed ones!) before creating your own. Thank you.
edit-mode: append