From 08157fbdce7d9b79ed4d37e2b6adefd1318d1164 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Tue, 31 May 2022 15:47:44 -0400 Subject: [PATCH] Add workflow to link to discuss on new question (#11825) * workflows: + automatic label/response on question When a user asks a question through an issue on this repository, we automatically add a comment, pointing to the forums, and add a label to the issue so we can spot more easily which issues need to be acted on. * .github: + link to packer community for questions As extra to the github action, this commit adds an extra button to the new issue template, leading directly to the discuss forums for Packer * .github: add auto-stale-close issue action As follow-up to the labelling of question type issues as needs-reply, we add another action that will automatically mark an issue as stale if it has not been updated for 3 weeks, and close the issue one week after marking it as stale. * Update .github/workflows/issues-opened.yml Co-authored-by: Wilken Rivera --- .github/ISSUE_TEMPLATE/config.yml | 5 ++++ .github/workflows/auto-close-stale-issues.yml | 23 +++++++++++++++++++ .github/workflows/issues-opened.yml | 21 +++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/workflows/auto-close-stale-issues.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..7221ea28b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Packer Community Support + url: https://discuss.hashicorp.com/c/packer/23 + about: If you have a question, or are looking for advice, please post on our Discuss forum! The community loves to chime in to help. Happy Coding! diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml new file mode 100644 index 000000000..afb891b1a --- /dev/null +++ b/.github/workflows/auto-close-stale-issues.yml @@ -0,0 +1,23 @@ +name: Close Stale Issues + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + stale-bot: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v5.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 23 + days-before-pr-stale: -1 # deactivate the action for PRs + days-before-close: 7 + stale-issue-message: | + Hi, + + This issue has not received any update in the last 3 weeks, and will automatically be closed in 7 days if it does not receive any activity by then. + + If you find the [community forum](https://discuss.hashicorp.com/c/packer) to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. + only-labels: needs-reply diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index 540a8398a..0e6eaf737 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -23,4 +23,25 @@ jobs: github-token: ${{ secrets.PACKER_PROJ_BOARD_TOKEN }} labeled: bug, enhancement label-operator: OR + label-question: + name: Redirect to discuss + if: contains(github.event.issue.labels.*.name, 'question') + runs-on: ubuntu-latest + steps: + - uses: actions-ecosystem/action-create-comment@v1.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + body: | + Hi 👋 thanks for reaching out. + + For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. + As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. + We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. + If no activity is taken on this question within 30 days it will be automatically closed. + + If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. + - uses: actions-ecosystem/action-add-labels@v1.1.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: needs-reply