Skip to content

Coordination for onboarding and removing organizers #7

Coordination for onboarding and removing organizers

Coordination for onboarding and removing organizers #7

Workflow file for this run

name: Greet New Contributor
on:
pull_request:
types: [opened]
jobs:
greet-and-remind:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Check if user is a new contributor
env:
GITHUB_EVENT_PATH: ${{ github.event_path }}
id: is-new-contributor
run: |
PR_AUTHOR=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
CONTRIBUTOR_COUNT=$(git log --format='%aN' | grep -i -c "^${PR_AUTHOR}$" || true)
echo "Contributor count: $CONTRIBUTOR_COUNT"
if [ "$CONTRIBUTOR_COUNT" -eq "0" ]; then
echo "new_contributor=true" >> $GITHUB_ENV
fi
- uses: actions/github-script@v6
name: "Comment to greet and remind"
if: env.new_contributor == 'true'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const PR_AUTHOR = context.payload.pull_request.user.login
await github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number}},
owner: 'rladies',
repo: 'rladiesguide',
body: `Welcome ${PR_AUTHOR}! It looks like this is your first contribution to this repository. 🎉\n\nPlease remember to add yourself to the '.zenodo.json'.`
})