Skip to content

fix: bots allowlist slug fallback in checkBotStatus#20526

Merged
pelikhan merged 4 commits intomainfrom
copilot/fix-bots-allowlist-issue
Mar 11, 2026
Merged

fix: bots allowlist slug fallback in checkBotStatus#20526
pelikhan merged 4 commits intomainfrom
copilot/fix-bots-allowlist-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

checkBotStatus only queried the collaborator API using the [bot]-suffixed actor form (e.g., greptile-apps[bot]). Many GitHub Apps return 404 for that form even when installed and actively triggering events — the plain slug form (greptile-apps) returns { permission: "none" } instead. The 404 was treated as "inactive", causing is_team_member=false regardless of the bots: allowlist.

Changes

  • check_permissions_utils.cjs: When the [bot] form returns 404, fall back to querying the non-[bot] slug form. Bot is only marked inactive if both forms return 404.
greptile-apps[bot]  →  404
  ↓ fallback
greptile-apps       →  { permission: "none" }  →  isActive: true ✅
  • check_permissions_utils.test.cjs: Added tests for slug fallback (success, [bot]-suffixed actor, both-404, non-404 slug error).
  • check_membership.test.cjs: Added integration-style tests covering the full allowlist flow with the new fallback, plus GH_AW_ALLOWED_BOTS cleanup in afterEach.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/gh 0508-40513/test-git GO111MODULE ache/node/24.14.--show-toplevel gh (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha test/race-image:v1.0.0 /tmp/go-build3452224307/b405/_testmain.go /usr/bin/git -json GO111MODULE 64/bin/go git -C /tmp/gh-aw-test-runs/20260311-140210-27860/test-2945569583 status /opt/hostedtoolcache/node/24.14.0/x64/bin/node .github/workflowgit GO111MODULE x_amd64/vet node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/ace-editor.md -dwarf=false /usr/bin/git go1.25.0 -c=4 -nolocalimports git rev-�� --show-toplevel /tmp/go-build88622314/b420/_testmain.go /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -bool -buildtags 0/x64/bin/node -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linuREDACTED t-ha�� ithub/workflows/audit-workflows.md l /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha user.name l /usr/bin/git -json GO111MODULE _modules/.bin/no--show-toplevel git init�� GOMODCACHE go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE DN/N6GE9dzJuLpfUe9tz4e_/aZSvDGNgorigin env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/vet /opt/hostedtoolcache/node/24.14.0/x64/bin/node -json GO111MODULE x_amd64/vet node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/audit-workflows.md x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git y.md .cfg ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 2224307/b025/vetrev-parse ache/go/1.25.0/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --get remote.origin.url /usr/bin/git k/gh-aw/gh-aw/pkgit **/*.cjs 64/bin/go git conf�� user.name Test User /usr/bin/git /tmp/go-build323git -trimpath 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha run-script/lib/n-bool 5360758/b407/imp-buildtags /usr/bin/git che/go-build/e4/git **/*.cjs 64/bin/go git conf�� --get remote.origin.url /usr/bin/git /tmp/go-build323git -trimpath 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha ternal/tools/actions-build/main.go GO111MODULE dAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linuTest User env 2224307/b372/_pkg_.a GO111MODULE .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha st-3730102091/.github/workflows 2224307/b101/vet.cfg .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linu1 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x--jq -uns�� 0210-27860/test-2945569583 /tmp/go-build3452224307/b247/vet.cfg 2224307/b413/importcfg.link GOSUMDB GOWORK 64/bin/go gUIYjN6c4lmkV/4fownHncp26b6DL2LBDN/N6GE9dzJuLpfUe9tz4e_/aZSvDGNgorigin (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha dyDE/oOxcY6fbL1BGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 5360758/b394/imp-buildtags /hom�� k/gh-aw/gh-aw/pk-errorsas k/gh-aw/gh-aw/pk-ifaceassert 64/bin/go **/*.json --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha k/gh-aw/gh-aw/tmp/smoke_test_225GOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK run-script/lib/n-unreachable=false /opt/hostedtoolc/tmp/go-build3452224307/b206/vet.cfg -o /tmp/go-build3235360758/b358/_pkGOINSECURE -trimpath 64/bin/go -p github.com/githu-atomic -lang=go1.25 go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha "prettier" --check '**/*.cjs' '*GOINSECURE ache/go/1.25.0/x64/src/internal/GOMOD 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolc-buildtags -o /tmp/go-build323-errorsas -trimpath 64/bin/go -d github.com/githu-atomic -lang=go1.25 go (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /repos/actions/github-script/git/ref/tags/v8 --jq /usr/bin/git k/gh-aw/gh-aw/scgit k/gh-aw/gh-aw/screv-parse 64/bin/go git conf�� --get remote.origin.url /usr/bin/git /tmp/go-build323git -trimpath 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /tmp/TestHashConsistency_GoAndJavaScript2595444399/001/test-complex-frontmatter-with-tools.md -extld=gcc /usr/bin/gh -json GO111MODULE ache/go/1.25.0/x--show-toplevel gh api t t /usr/bin/git '**/*.ts' '**/*.git GO111MODULE 8d519d9/node_mod--show-toplevel git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-test-runs/20260311-140210-27860/test-4116440174/.github/workflows rev-parse ache/node/24.14.0/x64/bin/node che/go-build/f9/git **/*.cjs 64/bin/go git t-40�� k/gh-aw/gh-aw/.github/workflows/artifacts-summary.md remote.origin.url /usr/bin/git /tmp/go-build323git -trimpath 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/compile-instructions-test-887616173/.github/workflows config /usr/bin/gh remote.origin.urgit GO111MODULE de/node/bin/sh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq ache/node/24.14.0/x64/bin/node '**/*.ts' '**/*.git GO111MODULE ache/go/1.25.0/x--show-toplevel ache/node/24.14.0/x64/bin/node (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --porcelain .cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linutest@example.com -uns�� -unreachable=false /tmp/go-build3452224307/b102/vet.cfg 2224307/b378/vet.cfg -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu--json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha /test1.md /test2.lock.yml 22314/b405/repoutil.test -json GO111MODULE 64/bin/go 22314/b405/repoutil.test e=/t�� 0553-42147/test-2596791057 m0s /usr/bin/git -json (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha plorer.md .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User estl�� -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linu-importcfg GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE /home/REDACTED/work/_temp/ghcca-node/node/bin/sh l GOMOD GOMODCACHE sh -c "prettier" --check '**/*.cjs' '**/*.ts' '**/*.jstest-logs/run-2 GOPROXY 64/bin/bash GOSUMDB GOWORK 64/bin/go bash (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env es.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE /snap/bin/sh GOINSECURE GOMOD GOMODCACHE sh -c 01/main.md GOPROXY 0/x64/bin/bash GOSUMDB GOWORK 64/bin/go bash (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE ache/node/24.14.0/x64/bin/node GOINSECURE GOMOD GOMODCACHE 1A/liMzR8Ds-CnfJ51RFpkM/VexT1r4Hremote.origin.url t-34�� k/gh-aw/gh-aw/.github/workflows/agent-performance-analyzer.md **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE ache/node/24.14.0/x64/bin/node GOINSECURE GOMOD GOMODCACHE node t-40�� k/gh-aw/gh-aw/.github/workflows/agent-performance-analyzer.md **/*.cjs 64/pkg/tool/linux_amd64/compile **/*.json --ignore-path ../../../.prettiValue: ${{ github.actor }} 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE /home/REDACTED/work/gh-aw/gh-aw/actions/setup/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE node /hom�� -aw/git/ref/tags/v2.0.0 **/*.cjs /usr/bin/git **/*.json --ignore-path ../../../.pretti--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node /opt�� prettier --check 64/bin/go --ignore-path .prettierignore 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path "prettier" --wriGOINSECURE git 64/bin/go tags/v4 2KdsE1cDIZcC61Yv-c /usr/bin/git sh -c npx prettier --wGOSUMDB git 64/bin/go --show-toplevel ache/go/1.25.0/x/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier /usr/bin/git go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 0XVD7GS/mRL0tEU7JbrieQ94-F8q env 187458683/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha archie.md GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu-test.timeout=10m0s env -json GO111MODULE k/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha "prettier" --check 'scripts/**/*GOINSECURE sh 64/bin/go tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha q "All matched files use Prettier code style"; then \ echo "JSON files are not formatted. Run '/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet git 64/bin/go --show-toplevel ache/go/1.25.0/x-c /usr/bin/git go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha ays.md GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env .js' --ignore-pa-p GO111MODULE 64/pkg/tool/linu-lang=go1.25 GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --check scripts/**/*.js 64/bin/go .prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha echo "��� JavaScript formatting GOINSECURE sh 64/bin/go tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha "prettier" --wriGOSUMDB git 64/bin/go --show-toplevel ache/go/1.25.0/x.github/aw/actions-lock.json /usr/bin/git go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --check scripts/**/*.js 64/bin/go .prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha "prettier" --wriGOSUMDB pkg/workflow/engGOWORK 64/bin/go --show-toplevel ache/go/1.25.0/xinstall-gh-aw.sh /usr/bin/git go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json GO111MODULE 8d519d9/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE go 8d51�� -json GO111MODULE dAt,startedAt,up-nilfunc GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json 051a2849:go.mod 0/x64/bin/node GOINSECURE GOMOD GOMODCACHE go t-ha�� ub/workflows GO111MODULE k/gh-aw/gh-aw/no-nolocalimports GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOSUMDB GOWORK 64/bin/go sh -c "prettier" --check 'scripts/**/*.js' --ignore-path .prettierignore l 64/pkg/tool/linux_amd64/compile tierignore git 64/bin/go 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOSUMDB GOWORK 64/bin/go sh -c "prettier" --che-errorsas node 64/bin/go prettier --write 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOSUMDB GOWORK 64/bin/go sh -c "prettier" --che-c=4 node 64/bin/go prettier --write 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go --show-toplevel ache/go/1.25.0/xprettier /usr/bin/git sh -c npx prettier --w**/*.json git 64/bin/go --show-toplevel ache/go/1.25.0/x/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier run-script/lib/n--check go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build3452224307/b383/cli.test /tmp/go-build3452224307/b383/cli.test -test.testlogfile=/tmp/go-build3452224307/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE 5360758/b396/imp/tmp/go-build3452224307/b145/vet.cfg -c k/gh-aw/gh-aw/pkgo1.25.0 k/gh-aw/gh-aw/pk-c=4 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolc-buildtags (http block)
    • Triggering command: /tmp/go-build310133497/b383/cli.test /tmp/go-build310133497/b383/cli.test -test.testlogfile=/tmp/go-build310133497/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true **/*.json --ignore-path ../../../.prettiif ! cd actions/setup/js && npm run check:pkg-json 2>&1 | grep -q "All matched files use Prettier code style"; then \ echo "JSON files are not formatted. Run 'make fmt-json' to fix."; \ exit 1; \ fi node /hom�� --write scripts/**/*.js 64/bin/go .prettierignore --log-level=erro-c /usr/bin/git golangci-lint (http block)
    • Triggering command: /tmp/go-build88622314/b001/cli.test /tmp/go-build88622314/b001/cli.test -test.testlogfile=/tmp/go-build88622314/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.run=^Test -test.short=true 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name _AxF/H2l9qBHVWYrGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 5360758/b403/imp/tmp/go-build3452224307/b181/vet.cfg /hom�� che/go-build/14/144522c24eae70baGOINSECURE **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name "prettier" --wriGOINSECURE git 64/bin/go --show-toplevel ache/go/1.25.0/x-c /usr/bin/git sh -c npx prettier --wGOSUMDB git 64/bin/go --show-toplevel ache/go/1.25.0/x/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier /usr/bin/git go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 3411890197/.github/workflows GO111MODULE tions/setup/js/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…check

When a GitHub App (e.g., Greptile, Copilot) triggers an event and is in the
bots: allowlist, checkBotStatus was querying getCollaboratorPermissionLevel
with the [bot]-suffixed form (e.g., greptile-apps[bot]). For GitHub Apps that
appear as plain slugs in the collaborator API, this returned 404, causing the
bot to be incorrectly marked as inactive and the workflow to not activate.

Fix: when the [bot]-suffixed form returns 404, fall back to the slug (non-[bot])
form. Only mark the bot as inactive if both forms return 404.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix allowlist not overriding pre_activation team membership check fix: bots allowlist slug fallback in checkBotStatus Mar 11, 2026
@pelikhan
Copy link
Contributor

@copilot look for existing bot name normalization helpers to reuse

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 11, 2026

@copilot look for existing bot name normalization helpers to reuse

Done in 8afeb8f. The existing canonicalizeBotIdentifier helper is now used to compute actorSlug instead of duplicating the [bot] suffix stripping logic inline.

@pelikhan pelikhan marked this pull request as ready for review March 11, 2026 14:25
Copilot AI review requested due to automatic review settings March 11, 2026 14:25
@pelikhan pelikhan merged commit 7a04376 into main Mar 11, 2026
51 checks passed
@pelikhan pelikhan deleted the copilot/fix-bots-allowlist-issue branch March 11, 2026 14:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes bot allowlist authorization by updating checkBotStatus to fall back from the <slug>[bot] collaborator lookup to the plain <slug> form when the [bot] form returns 404, avoiding false “inactive bot” results for some GitHub Apps.

Changes:

  • Add slug-form fallback in checkBotStatus when the [bot] lookup returns 404; only mark inactive if both forms 404.
  • Add unit tests for the fallback behavior and error cases in check_permissions_utils.test.cjs.
  • Add integration-style allowlist flow tests in check_membership.test.cjs, plus env cleanup for GH_AW_ALLOWED_BOTS.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
actions/setup/js/check_permissions_utils.cjs Adds 404-driven fallback from [bot] username to plain slug when checking collaborator permission level.
actions/setup/js/check_permissions_utils.test.cjs Adds unit tests covering fallback success, actor already suffixed, both-404, and non-404 slug errors.
actions/setup/js/check_membership.test.cjs Adds allowlist-flow tests validating authorization behavior with the new fallback and cleans up bot allowlist env var after tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +80 to 84
// If we get a 404, the [bot]-suffixed form may not be listed as a collaborator.
// Fall back to checking the non-[bot] (slug) form, as some GitHub Apps appear
// under their plain slug name rather than the [bot]-suffixed form.
// @ts-expect-error - Error handling with optional chaining
if (botError?.status === 404) {
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slug fallback makes checkBotStatus() return { isBot: true, isActive: true } for any allowlisted human collaborator whenever <user>[bot] 404s and the plain <user> lookup succeeds. That changes GH_AW_ALLOWED_BOTS from “bots only” to a general override that can bypass GH_AW_REQUIRED_ROLES for regular users. Consider gating the slug fallback (or the isBot: true result) on an explicit bot signal (e.g., context.payload.sender.type === "Bot" when available, or a caller-provided isBotActor flag), so allowlisting a non-bot username can’t silently authorize a user with insufficient permissions.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bots: allowlist does not override pre_activation team membership check

3 participants