GitHub provides a label on the user to identify them as a first-time contributor. This label is helpful because it's also exposed in API and provides a path for an excellent first-time contributor experience.
The GitHub Action team maintains an Action called first-interaction, and it provides some inputs to give a welcome message. Contributors. Now, this is more than just a simple, hello message.
actions / first-interaction
An action for filtering pull requests and issues from first-time contributors
To enable this functionality, we need our workflow to run pull requests originated from forks. We can achieve this with the pull_request_target.
The pull_request_target event runs in the context of the base of the pull request, rather than in the merge commit as the pull_request event does. This prevents executing unsafe workflow code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow.
Now we can welcome first-time contributors into our project on their first interaction.
This is part of my 28 days of Actions series. To get notified of more GitHub Action tips, follow the GitHub organization right here on Dev.
Learn more about GitHub Actions in our Community Support Forums.
Top comments (1)
I actually need this - thanks