Compare commits

..

3 Commits

Author SHA1 Message Date
Noah Zweben MacBook
e5bd3dfed1 Use collaborator permission check instead of org membership 2026-01-06 19:16:31 -08:00
Noah Zweben
76334d1f67 Add write permissions for external PR workflow (#143)
* Add write permissions for external PR workflow

* Use pulls.createReview instead of issues.createComment

* Revert to issues.createComment with proper permissions
2026-01-06 17:09:02 -08:00
Noah Zweben
44328beed4 Rename ralph-wiggum plugin to ralph-loop per legal guidance (#142)
- Rename plugin from "ralph-wiggum" to "ralph-loop" to avoid trademark concerns
- Update all internal references to use "Ralph Loop" as the prominent name
- Keep explanatory text noting it "implements the Ralph Wiggum technique" (allowed)
- Rename plugin directory from plugins/ralph-wiggum to plugins/ralph-loop
- Update marketplace.json with new plugin name and source path
- Update plugin-dev documentation references

This change follows legal's recommendation to replace "Wiggum" with "Loop"
in the plugin name while still explaining the technique origin.

Slack thread: https://anthropic.slack.com/archives/C09KU300P7F/p1767741142753959

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-06 15:22:54 -08:00

View File

@@ -4,40 +4,44 @@ on:
pull_request_target:
types: [opened]
permissions:
pull-requests: write
issues: write
jobs:
check-membership:
if: vars.DISABLE_EXTERNAL_PR_CHECK != 'true'
runs-on: ubuntu-latest
steps:
- name: Check if author is org member
- name: Check if author has write access
uses: actions/github-script@v7
with:
script: |
const org = 'anthropics';
const author = context.payload.pull_request.user.login;
try {
await github.rest.orgs.checkMembershipForUser({
org: org,
username: author
});
console.log(`${author} is an org member, allowing PR`);
} catch (e) {
if (e.status === 404) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: `Thanks for your interest! This repo only accepts contributions from Anthropic team members. If you'd like to submit a plugin to the marketplace, please submit your plugin [here](https://docs.google.com/forms/d/e/1FAIpQLSdeFthxvjOXUjxg1i3KrOOkEPDJtn71XC-KjmQlxNP63xYydg/viewform).`
});
const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: author
});
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
state: 'closed'
});
console.log(`Closed PR from external contributor: ${author}`);
}
if (['admin', 'write'].includes(data.permission)) {
console.log(`${author} has ${data.permission} access, allowing PR`);
return;
}
console.log(`${author} has ${data.permission} access, closing PR`);
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: `Thanks for your interest! This repo only accepts contributions from Anthropic team members. If you'd like to submit a plugin to the marketplace, please submit your plugin [here](https://docs.google.com/forms/d/e/1FAIpQLSdeFthxvjOXUjxg1i3KrOOkEPDJtn71XC-KjmQlxNP63xYydg/viewform).`
});
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
state: 'closed'
});