From 0e85b42973cad4a9aade1041aad8c47541a55413 Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Tue, 4 Mar 2025 14:20:46 -0800 Subject: [PATCH 1/3] Add workflow to welcome first-time contributors --- .github/workflows/first-interaction.yaml | 85 ++++++++++++++++++++++++ 1 file changed, 85 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..eca3988bd62 --- /dev/null +++ b/.github/workflows/first-interaction.yaml @@ -0,0 +1,85 @@ +# 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: Check out a copy of the git repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - 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! We are glad you are here and are excited to see your first + contribution. Please keep in mind our [community participation + guidelines](${{env.files}}/CODE_OF_CONDUCT.md). + + If this is a bug report, we will probably need the following + details in order to diagnose the issue. If you did not include it + in the original issue description, please consider providing it + now because it will probably save everyone time in the long run: + + - [ ] Environment you are using (MacOS, Windows, Colab, etc.) + - [ ] Version of Python you are using + - [ ] Steps to reproduce the issue + + Please allow time for the project community to be able to read the + issue and act on it. In the meantime, you may want to look through + the [existing open issues](${{env.repo}}/issues) to see if any look + similar to yours. If you find a similar or identical issue, + consider closing this one; if you don't want to close this one, it + would be helpful if you could write a comment here that references + the related issue and explains how this new one differs from the + other one. + + This is an automatically-generated message. + pr-message: | + Hello and welcome, ${{github.actor}} 👋! + + Thanks for making your first pull request to the + ${{github.repository}} project! We are glad you are here and are + excited to see your first contribution. Please keep in mind our + [community code of conduct](${{env.files}}/CODE_OF_CONDUCT.md). + + Since this is your first pull request with this project, the + automated check for the Google [Contributor License + Agreement](https://cla.developers.google.com/about) (CLA) will + trigger and may request that you to sign the CLA. More information + about the agreement can be found in the project's [contributing + guide](${{env.files}}/CONTRIBUTING.md). + + If this pull request is to fix a bug, please reference the relevant + issue number in the project [issue tracker](${{env.repo}}/issues). + + Please allow time for the project community to be able to read and + evaluate your pull request. + + This is an automatically-generated message. From 7eb7c0f72ce4cf08491266345dec0db3979ce11c Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Fri, 7 Mar 2025 13:54:18 -0800 Subject: [PATCH 2/3] Remove unnecessary actions/checkout step --- .github/workflows/first-interaction.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/first-interaction.yaml b/.github/workflows/first-interaction.yaml index eca3988bd62..9111bb7874e 100644 --- a/.github/workflows/first-interaction.yaml +++ b/.github/workflows/first-interaction.yaml @@ -27,9 +27,6 @@ jobs: repo: ${{github.server_url}}/${{github.repository}} files: ${{github.server_url}}/${{github.repository}}/blob/${{github.ref_name}} steps: - - name: Check out a copy of the git repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Add a welcome comment if appropriate uses: actions/first-interaction@2ec0f0fd78838633cd1c1342e4536d49ef72be54 # v1.3.0 with: From 9620f629c3e440079a35eb5086f6640c1b92c5ff Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Fri, 7 Mar 2025 13:55:51 -0800 Subject: [PATCH 3/3] 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 | 58 ++++++++++-------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/.github/workflows/first-interaction.yaml b/.github/workflows/first-interaction.yaml index 9111bb7874e..c32dfd87abb 100644 --- a/.github/workflows/first-interaction.yaml +++ b/.github/workflows/first-interaction.yaml @@ -35,48 +35,40 @@ jobs: Hello and welcome, ${{github.actor}} 👋! Thanks for filing your first issue with the ${{github.repository}} - project! We are glad you are here and are excited to see your first - contribution. Please keep in mind our [community participation - guidelines](${{env.files}}/CODE_OF_CONDUCT.md). + project! Here are some quick tips: - If this is a bug report, we will probably need the following - details in order to diagnose the issue. If you did not include it - in the original issue description, please consider providing it - now because it will probably save everyone time in the long run: + - Please make sure to read our [community participation + guidelines](${{env.files}}/CODE_OF_CONDUCT.md). - - [ ] Environment you are using (MacOS, Windows, Colab, etc.) - - [ ] Version of Python you are using - - [ ] Steps to reproduce the issue + - 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: - Please allow time for the project community to be able to read the - issue and act on it. In the meantime, you may want to look through - the [existing open issues](${{env.repo}}/issues) to see if any look - similar to yours. If you find a similar or identical issue, - consider closing this one; if you don't want to close this one, it - would be helpful if you could write a comment here that references - the related issue and explains how this new one differs from the - other one. + - [ ] Environment you are using (MacOS, Windows, Colab, etc.) + - [ ] Version of Python you are using + - [ ] Steps to reproduce the issue - This is an automatically-generated message. + - 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! We are glad you are here and are - excited to see your first contribution. Please keep in mind our - [community code of conduct](${{env.files}}/CODE_OF_CONDUCT.md). + ${{github.repository}} project! Here are some quick tips: - Since this is your first pull request with this project, the - automated check for the Google [Contributor License - Agreement](https://cla.developers.google.com/about) (CLA) will - trigger and may request that you to sign the CLA. More information - about the agreement can be found in the project's [contributing - guide](${{env.files}}/CONTRIBUTING.md). + - Please make sure to read the [contributing + guide](${{env.files}}/CONTRIBUTING.md) and [community participation + guidelines](${{env.files}}/CODE_OF_CONDUCT.md). - If this pull request is to fix a bug, please reference the relevant - issue number in the project [issue tracker](${{env.repo}}/issues). + - 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. - Please allow time for the project community to be able to read and - evaluate your pull request. + - If this pull request fixes a bug, please reference the relevant + issue number in the [issue tracker](${{env.repo}}/issues). - This is an automatically-generated message. + Please allow time for the project community to be able to read and + evaluate your pull request. Thanks again!