Skip to content
Open

Push #101

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 33 additions & 14 deletions .github/workflows/contributor-onboarding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ name: Contributor Onboarding

on:
pull_request_target:
types: [closed]
types: [opened, closed]
branches: [main, master, develop, test]
issue_comment:
types: [created]

permissions:
pull-requests: write
issues: write
contents: write

jobs:
# Request Discord ID and wallet from first-time contributors
# Request Discord ID and wallet from contributors (on PR open)
request-info:
if: |
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'first-time-contributor')
github.event_name == 'pull_request_target' &&
github.event.action == 'opened' &&
github.repository_owner == 'StabilityNexus'
uses: StabilityNexus/ContributorAutomation/.github/workflows/reusable-request-info.yml@main
with:
pr_number: ${{ github.event.pull_request.number }}
Expand All @@ -27,17 +26,37 @@ jobs:
secrets:
GIST_PAT: ${{ secrets.GIST_PAT }}

# Process contributor response with Discord ID and wallet
# Calculate lines changed for merged PRs
calculate-changes:
if: |
github.event_name == 'pull_request_target' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true &&
github.repository_owner == 'StabilityNexus'
runs-on: ubuntu-latest
outputs:
lines_changed: ${{ steps.calc.outputs.lines_changed }}
steps:
- name: Calculate lines changed
id: calc
run: |
lines_changed=$(( ${{ github.event.pull_request.additions }} + ${{ github.event.pull_request.deletions }} ))
echo "lines_changed=${lines_changed}" >> "$GITHUB_OUTPUT"

# Process contributor info from all PR comments (on PR merge)
process-response:
needs: calculate-changes
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
(contains(github.event.comment.body, 'discord:') || contains(github.event.comment.body, 'Discord:'))
github.event_name == 'pull_request_target' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true &&
github.repository_owner == 'StabilityNexus'
uses: StabilityNexus/ContributorAutomation/.github/workflows/reusable-process-response.yml@main
with:
pr_number: ${{ github.event.issue.number }}
pr_number: ${{ github.event.pull_request.number }}
repo_name: ${{ github.repository }}
comment_body: ${{ github.event.comment.body }}
commenter: ${{ github.event.comment.user.login }}
pr_author: ${{ github.event.pull_request.user.login }}
pr_title: ${{ github.event.pull_request.title }}
lines_changed: ${{ needs.calculate-changes.outputs.lines_changed }}
secrets:
GIST_PAT: ${{ secrets.GIST_PAT }}
Loading