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

[infra] Switch 'add closing message' to reusable workflow #14499

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
31 changes: 5 additions & 26 deletions .github/workflows/closed-issue-message.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Add comment
name: Add closing message to issue

on:
issues:
Expand All @@ -9,30 +9,9 @@ permissions: {}

jobs:
add-comment:
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 but not exactly the same, please open a [new issue](https://github.com/mui/mui-x/issues/new/choose).
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
APPENDIX: |

@${{ github.event.issue.user.login }}: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short [Support Satisfaction survey](https://tally.so/r/w4r5Mk?issue=${{ github.event.issue.number }}&productId=x).

if: github.event.issue.state_reason != 'inactivity'
runs-on: ubuntu-latest
name: Add closing message
if: github.event.issue.state_reason == 'completed'
uses: mui/mui-public/.github/workflows/issues_add-closing-message.yml@master
permissions:
contents: read
issues: write
steps:
- uses: actions-cool/check-user-permission@956b2e73cdfe3bcb819bb7225e490cb3b18fd76e
id: checkUser
with:
require: 'write'
username: ${{ github.event.issue.user.login }}
- name: Add comment for outside contributors
if: steps.checkUser.outputs.check-result == false
run: gh issue comment "$NUMBER" --body "$BODY $APPENDIX"
- name: Add comment for maintainers
if: steps.checkUser.outputs.check-result == true
run: gh issue comment "$NUMBER" --body "$BODY"
Loading