Skip to content

Commit 5158d08

Browse files
Add workflow to welcome first-time contributors (#50)
This adds a workflow that triggers on new issues and PRs. If the author has not contributed to this repository before, the workflow will add a comment with an informative welcome message to the issue or PR. The goal is to try to be welcoming of contributions and simultaneously steer people towards information they may have missed.
2 parents 3f22545 + 497ba26 commit 5158d08

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Summary: add a welcoming comment to first-time contributors' issues & PRs.
2+
# This is written in a generic way so that we can use the same workflow
3+
# in all our quantumlib repos.
4+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
6+
name: Welcome first interactions
7+
run-name: Welcome ${{github.actor}}'s first interaction
8+
9+
on:
10+
issues:
11+
types: [opened]
12+
pull_request:
13+
types: [opened]
14+
15+
# Declare default permissions as read-only.
16+
permissions: read-all
17+
18+
jobs:
19+
welcome:
20+
name: Check for first interaction
21+
runs-on: ubuntu-24.04
22+
timeout-minutes: 10
23+
permissions:
24+
issues: write
25+
pull-requests: write
26+
env:
27+
repo: ${{github.server_url}}/${{github.repository}}
28+
files: ${{github.server_url}}/${{github.repository}}/blob/${{github.ref_name}}
29+
steps:
30+
- name: Check out a copy of the git repository
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
32+
33+
- name: Add a welcome comment if appropriate
34+
uses: actions/first-interaction@2ec0f0fd78838633cd1c1342e4536d49ef72be54 # v1.3.0
35+
with:
36+
repo-token: ${{secrets.GITHUB_TOKEN}}
37+
issue-message: |
38+
Hello and welcome, ${{github.actor}} 👋!
39+
40+
Thanks for filing your first issue with the ${{github.repository}}
41+
project! We are glad you are here and are excited to see your first
42+
contribution. Please keep in mind our [community participation
43+
guidelines](${{env.files}}/CODE_OF_CONDUCT.md).
44+
45+
If this is a bug report, we will probably need the following
46+
details in order to diagnose the issue. If you did not include it
47+
in the original issue description, please consider providing it
48+
now because it will probably save everyone time in the long run:
49+
50+
- [ ] Environment you are using (MacOS, Windows, Colab, etc.)
51+
- [ ] Version of Python you are using
52+
- [ ] Steps to reproduce the issue
53+
54+
Please allow time for the project community to be able to read the
55+
issue and act on it. In the meantime, you may want to look through
56+
the [existing open issues](${{env.repo}}/issues) to see if any look
57+
similar to yours. If you find a similar or identical issue,
58+
consider closing this one; if you don't want to close this one, it
59+
would be helpful if you could write a comment here that references
60+
the related issue and explains how this new one differs from the
61+
other one.
62+
63+
This is an automatically-generated message.
64+
pr-message: |
65+
Hello and welcome, ${{github.actor}} 👋!
66+
67+
Thanks for making your first pull request to the
68+
${{github.repository}} project! We are glad you are here and are
69+
excited to see your first contribution. Please keep in mind our
70+
[community code of conduct](${{env.files}}/CODE_OF_CONDUCT.md).
71+
72+
Since this is your first pull request with this project, the
73+
automated check for the Google [Contributor License
74+
Agreement](https://cla.developers.google.com/about) (CLA) will
75+
trigger and may request that you to sign the CLA. More information
76+
about the agreement can be found in the project's [contributing
77+
guide](${{env.files}}/CONTRIBUTING.md).
78+
79+
If this pull request is to fix a bug, please reference the relevant
80+
issue number in the project [issue tracker](${{env.repo}}/issues).
81+
82+
Please allow time for the project community to be able to read and
83+
evaluate your pull request.
84+
85+
This is an automatically-generated message.

0 commit comments

Comments
 (0)