From 965490fdcbdacefa59d54d4ae025c5490aedf49b Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Fri, 7 Mar 2025 14:45:34 -0800 Subject: [PATCH] Add workflow to welcome first-time contributors (#7121) * Add workflow to welcome first-time contributors * Remove unnecessary actions/checkout step * Rewrite to shorten & avoid the "wall of text" Early feedback from Craig is that the previous text was too dense. I'm not sure it was that bad, but we can still do better, and add a bit more info while we're att it. Here's version 2.0 of the text. --- .github/workflows/first-interaction.yaml | 74 ++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/first-interaction.yaml diff --git a/.github/workflows/first-interaction.yaml b/.github/workflows/first-interaction.yaml new file mode 100644 index 00000000000..c32dfd87abb --- /dev/null +++ b/.github/workflows/first-interaction.yaml @@ -0,0 +1,74 @@ +# Summary: add a welcoming comment to first-time contributors' issues & PRs. +# This is written in a generic way so that we can use the same workflow +# in all our quantumlib repos. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +name: Welcome first interactions +run-name: Welcome ${{github.actor}}'s first interaction + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +# Declare default permissions as read-only. +permissions: read-all + +jobs: + welcome: + name: Check for first interaction + runs-on: ubuntu-24.04 + timeout-minutes: 10 + permissions: + issues: write + pull-requests: write + env: + repo: ${{github.server_url}}/${{github.repository}} + files: ${{github.server_url}}/${{github.repository}}/blob/${{github.ref_name}} + steps: + - name: Add a welcome comment if appropriate + uses: actions/first-interaction@2ec0f0fd78838633cd1c1342e4536d49ef72be54 # v1.3.0 + with: + repo-token: ${{secrets.GITHUB_TOKEN}} + issue-message: | + Hello and welcome, ${{github.actor}} 👋! + + Thanks for filing your first issue with the ${{github.repository}} + project! Here are some quick tips: + + - Please make sure to read our [community participation + guidelines](${{env.files}}/CODE_OF_CONDUCT.md). + + - If this is a bug report, we'll probably need the following + details in order to diagnose the issue. If they're not in the + original issue description, please consider adding them now: + + - [ ] Environment you are using (MacOS, Windows, Colab, etc.) + - [ ] Version of Python you are using + - [ ] Steps to reproduce the issue + + - Please look through [existing issues](${{env.repo}}/issues) for + any that look the same as this one. If you find a similar issue, + consider closing this one; if you don't want to close this one, can + you explain how this new one differs from the other one? + pr-message: | + Hello and welcome, ${{github.actor}} 👋! + + Thanks for making your first pull request to the + ${{github.repository}} project! Here are some quick tips: + + - Please make sure to read the [contributing + guide](${{env.files}}/CONTRIBUTING.md) and [community participation + guidelines](${{env.files}}/CODE_OF_CONDUCT.md). + + - All contributors must sign the [Contributor License + Agreement](https://cla.developers.google.com/about) (CLA). If + [googlebot](https://github.com/googlebot) leaves a comment on this + pull request, make sure you follow the instructions it provides. + + - If this pull request fixes a bug, please reference the relevant + issue number in the [issue tracker](${{env.repo}}/issues). + + Please allow time for the project community to be able to read and + evaluate your pull request. Thanks again!