woocommerce/.github/workflows/triage-replies.yml

121 lines
5.5 KiB
YAML

name: Add issue triage comments.
on:
issues:
types:
- labeled
jobs:
add-dev-comment:
if: "github.event.label.name == 'needs: developer feedback'"
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add developer feedback comment
uses: actions/github-script@v5
with:
github-token: ${{ secrets.WC_BOT_TRIAGE_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hi @${{ github.event.issue.user.login }},\n\n\
Thank you for opening the issue! It requires further feedback from the WooCommerce Core team.\n\n\
We are adding the `needs developer feedback` label to this issue so that the Core team could take a look.\n\n\
Please note it may take a few days for them to get to this issue. Thank you for your patience.'
})
add-reproduction-comment:
if: "github.event.label.name == 'status: reproduction'"
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add needs reproduction comment
uses: actions/github-script@v5
with:
github-token: ${{ secrets.WC_BOT_TRIAGE_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'We are adding the `status: needs reproduction` label to this issue to try reproduce it on the \
current released version of WooCommerce.\n\n\
Thank you for your patience.'
})
add-support-comment:
if: "github.event.label.name == 'type: support request'"
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add support request comment
uses: actions/github-script@v5
with:
github-token: ${{ secrets.WC_BOT_TRIAGE_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hi @${{ github.event.issue.user.login }},\n\n\
While our goal is to address all the issues reported in this repository, \
GitHub should be treated as a place to report confirmed bugs only.\n\n\
The type of issue you submitted looks like a support request which may or may not reveal a bug once proper \
troubleshooting is done. In order to confirm the bug, please follow one of the steps below:\n\n\
- Review [WooCommerce Self-Service Guide](https://docs.woocommerce.com/document/woocommerce-self-service-guide/) \
to see if the solutions listed there apply to your case;\n\
- If you are a paying customer of WooCommerce, contact WooCommerce support by \
[opening a ticket or starting a live chat](https://woocommerce.com/contact-us/);\n\
- Make a post on [WooCommerce community forum](https://wordpress.org/support/plugin/woocommerce/)\n\n\
If you confirm the bug, please provide us with clear steps to reproduce it.\n\n\
We are closing this issue for now as it seems to be a support request and not a bug. \
If we missed something, please leave a comment and we will take a second look.'
})
- name: Close support request issue
uses: actions/github-script@v5
with:
github-token: ${{ secrets.WC_BOT_TRIAGE_TOKEN }}
script: |
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed'
})
add-votes-comment:
if: "github.event.label.name == 'needs: votes'"
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add votes needed comment
uses: actions/github-script@v5
with:
github-token: ${{ secrets.WC_BOT_TRIAGE_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Thanks for the suggestion @${{ github.event.issue.user.login }},\n\n\
While we appreciate you sharing your ideas with us, it doesn't fit in with our current priorities for the project.\n\
At some point, we may revisit our priorities and look through the list of suggestions like this one to see if it \
warrants a second look.\n\n\
In the meantime, we are going to close this issue with the `votes needed` label and evaluate over time if this \
issue collects more feedback.\n\n\
Don't be alarmed if you don't see any activity on this issue for a while. \
We'll keep an eye on the popularity of this request."
})
- name: Close votes needed issue
uses: actions/github-script@v5
with:
github-token: ${{ secrets.WC_BOT_TRIAGE_TOKEN }}
script: |
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed'
})