Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: lock conversations on closed issues and PRs with message #30941

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/closed-issue-message.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/lock-issue-pr-with-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Lock Closed Issues and PRs with message

on:
pull_request_target:
types: [closed]
issues:
types: [closed]

jobs:
auto_comment:
permissions:
pull-requests: write
issues: write
runs-on: ubuntu-latest
steps:
- uses: aws-actions/closed-issue-message@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line should be removed, I think community will not be able to add comments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I missed this line while reviewing the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good point. Let me remove it.

lock:
permissions:
pull-requests: write
issues: write
runs-on: ubuntu-latest
needs: auto_comment
steps:
- name: Lock closed issue or PR
run: |
if [ "${{ github.event_name }}" == "issues" ]; then
ISSUE_NUMBER=${{ github.event.issue.number }}
ISSUE_URL=https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}/lock
else
ISSUE_NUMBER=${{ github.event.pull_request.number }}
ISSUE_URL=https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}/lock
fi

curl -s -X PUT -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
${ISSUE_URL} \
-d @- <<EOF
{
"lock_reason": "resolved"
}
EOF
Loading