Skip to content

Commit

Permalink
chore: only run actions for thirdweb people
Browse files Browse the repository at this point in the history
  • Loading branch information
gregfromstl committed Dec 13, 2024
1 parent 9954b37 commit 8ed4558
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Auto Author Assign

on:
pull_request:
types: [ opened, reopened ]
types: [ opened, reopened, ready_for_review ]

permissions:
pull-requests: write
Expand All @@ -11,4 +11,19 @@ jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
- name: Check contributor status and assign author
uses: actions/github-script@v7
with:
script: |
const isInternalContributor = ['MEMBER', 'OWNER', 'COLLABORATOR'].includes(
context.payload.pull_request.author_association
);
if (!isInternalContributor) {
console.log('External contributor detected - skipping author assignment');
return;
}
// Use the auto-assign action only for internal contributors
const { exec } = require('child_process');
exec('npx @toshimaru/auto-author-assign');
13 changes: 12 additions & 1 deletion .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Linked Issue

on:
pull_request:
types: [opened, edited]
types: [opened, edited, ready_for_review]

env:
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT|INSIGHT|ENGINE|CS|DES|BIL|DEVX|SOLU|NEB"
Expand All @@ -22,6 +22,17 @@ jobs:
pull_number: context.issue.number
});
// Check if contributor is external
const isInternalContributor = ['MEMBER', 'OWNER', 'COLLABORATOR'].includes(
context.payload.pull_request.author_association
);
// Automatically pass for external contributors
if (!isInternalContributor) {
console.log('External contributor detected - automatically passing check');
return;
}
const body = pr.data.body || '';
const branchName = pr.data.head.ref;
const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i');
Expand Down

0 comments on commit 8ed4558

Please sign in to comment.