Skip to content
Merged
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
40 changes: 40 additions & 0 deletions .github/workflows/unlock-reopened-issue-pr-with-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Unlock Reopened Issues and PRs with message

on:
pull_request_target:
types: [reopened]
issues:
types: [reopened]

jobs:
auto_comment:
permissions:
pull-requests: write
issues: write
runs-on: ubuntu-latest
steps:
- uses: aws-actions/closed-issue-message@v2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rix0rrr how do you feel about reusing this here? Despite the name, the action isn't actually specific to closed issues: https://github.com/aws-actions/closed-issue-message

with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
This issue has been reopened and is now available for discussion.
unlock:
permissions:
pull-requests: write
issues: write
runs-on: ubuntu-latest
needs: auto_comment # only run after comment is complete
steps:
- name: Unlock reopened 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 DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
${ISSUE_URL}
Loading