From a3f3d645ac56ccf0010c87ab056eaf8a53795797 Mon Sep 17 00:00:00 2001 From: Michel Engelen <32863416+michelengelen@users.noreply.github.com> Date: Thu, 8 Feb 2024 12:29:14 +0100 Subject: [PATCH] [code-infra] auto-message on closed issues (#11805) Signed-off-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com> Co-authored-by: Lukas --- .github/workflows/closed-issue-message.yaml | 31 +++++++++++++++++++++ .github/workflows/no-response.yml | 1 - 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/closed-issue-message.yaml diff --git a/.github/workflows/closed-issue-message.yaml b/.github/workflows/closed-issue-message.yaml new file mode 100644 index 000000000000..a14afd879f11 --- /dev/null +++ b/.github/workflows/closed-issue-message.yaml @@ -0,0 +1,31 @@ +name: Add comment +on: + issues: + types: + - closed +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + BODY: | + :warning: **This issue has been closed.** + If you have a similar problem, please open a [new issue](https://github.com/mui/mui-x/issues/new/choose) and provide details about your specific problem. + If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment. + APPENDIX: | + + **How did we do @${{ github.event.issue.user.login }}?** + Your experience with our support team matters to us. If you have a moment, please share your thoughts through our [brief survey](https://tally.so/r/w4r5Mk?issue=${{ github.event.issue.number }}). + +jobs: + add-comment: + if: github.event.issue.state_reason != 'inactivity' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add comment for outside contributors + if: github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'OWNER' + run: gh issue comment "$NUMBER" --body "$BODY $APPENDIX" + - name: Add comment for maintainers + if: github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'OWNER' + run: gh issue comment "$NUMBER" --body "$BODY" diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 3664edfcc0f8..6c5535c21824 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -30,4 +30,3 @@ jobs: # Comment to post when closing an Issue for lack of response. Set to `false` to disable closeComment: > The issue has been inactive for 7 days and has been automatically closed. - If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.