-
Notifications
You must be signed in to change notification settings - Fork 62
fix: treat unverifiable submitter access as warning instead of error #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,13 +155,14 @@ jobs: | |
| if [ "$HOST" = "github" ]; then | ||
| # GitHub: verify via API | ||
| ORG_REPO=$(echo "$REPO_URL" | sed 's|git@github.com:||' | sed 's|https://github.com/||' | sed 's|\.git$||') | ||
| if gh api "/repos/$ORG_REPO/collaborators/$SUBMITTER" 2>/dev/null; then | ||
| HTTP_CODE=$(gh api "/repos/$ORG_REPO/collaborators/$SUBMITTER" --silent 2>/dev/null; echo $?) | ||
| if [ "$HTTP_CODE" = "0" ]; then | ||
| echo "✅ $SUBMITTER is a collaborator on $ORG_REPO" | ||
| elif [ "$(gh api "/repos/$ORG_REPO" -q '.owner.login')" == "$SUBMITTER" ]; then | ||
| echo "✅ $SUBMITTER is the owner of $ORG_REPO" | ||
| else | ||
| echo "::error::$SUBMITTER does not have commit access to $ORG_REPO" | ||
| exit 1 | ||
| echo "::warning::Cannot verify submitter access for $ORG_REPO (API returned 403). Manual review required." | ||
| echo "⚠️ Submitter access must be verified manually by maintainers." | ||
|
Comment on lines
+158
to
+164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scope warning fallback to unverifiable cases only This branch now warns on all non-success outcomes, so a submitter without verified access is no longer blocked. That broadens behavior beyond “unverifiable only” and weakens the gate. Use a three-way outcome: collaborator/owner ✅, definitive no-access ❌ (fail), API-unverifiable Suggested patch- if gh api "/repos/$ORG_REPO/collaborators/$SUBMITTER" --silent 2>/dev/null; then
+ COLLAB_STATUS="$(gh api -i "/repos/$ORG_REPO/collaborators/$SUBMITTER" 2>/dev/null || true)"
+ COLLAB_HTTP="$(printf '%s\n' "$COLLAB_STATUS" | awk 'NR==1 {print $2}')"
+ if [ "$COLLAB_HTTP" = "204" ]; then
echo "✅ $SUBMITTER is a collaborator on $ORG_REPO"
elif [ "$(gh api "/repos/$ORG_REPO" -q '.owner.login')" == "$SUBMITTER" ]; then
echo "✅ $SUBMITTER is the owner of $ORG_REPO"
+ elif [ "$COLLAB_HTTP" = "404" ]; then
+ echo "::error::$SUBMITTER does not appear to have access to $ORG_REPO."
+ exit 1
else
echo "::warning::Cannot verify submitter access for $ORG_REPO (API check failed). Manual review required."
echo "⚠️ Submitter access must be verified manually by maintainers."
fi🤖 Prompt for AI Agents |
||
| fi | ||
| else | ||
| # Non-GitHub: cannot verify cross-platform access automatically | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.