diff --git a/.github/workflows/closed-issue-message.yml b/.github/workflows/closed-issue-message.yml index 94c735b2..690db9c8 100644 --- a/.github/workflows/closed-issue-message.yml +++ b/.github/workflows/closed-issue-message.yml @@ -3,37 +3,30 @@ name: Closed Issue Message on: issues: types: [closed] - pull_request_target: - types: [closed] permissions: issues: write - pull-requests: write jobs: post-message-and-lock: runs-on: ubuntu-latest steps: - - uses: aws-actions/closed-issue-message@v2 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: | - ⚠️ This issue has been closed. If you have a similar problem, please [open a new issue](../../issues/new/choose) and include relevant details so we can investigate properly. - - Comments on closed issues are hard for our team to track. A new issue ensures you get the attention you need. - pr-message: | - ⚠️ This pull request has been closed. If you'd like to continue this work, please open a new PR referencing this one for context. - - uses: actions/github-script@v7 with: script: | const { owner, repo } = context.repo; - const number = context.issue?.number || context.payload.pull_request?.number; - if (number) { - await github.rest.issues.lock({ - owner, - repo, - issue_number: number, - lock_reason: 'resolved' - }); - } + const number = context.issue.number; + + await github.rest.issues.createComment({ + owner, + repo, + issue_number: number, + body: '⚠️ This issue has been closed. If you have a similar problem, please [open a new issue](../../issues/new/choose) and include relevant details so we can investigate properly.\n\nComments on closed issues are hard for our team to track. A new issue ensures you get the attention you need.' + }); + + await github.rest.issues.lock({ + owner, + repo, + issue_number: number, + lock_reason: 'resolved' + });