Report inconclusive Slack placeholder-code checks accurately
Foundry Go checks / check (push) Successful in 2m9s
Foundry Go checks / check (pull_request) Successful in 1m57s

This commit is contained in:
2026-11-05 20:22:51 +08:00
parent 6c69fcbaaa
commit 155ce28c37
+5 -1
View File
@@ -17,7 +17,7 @@ jobs:
test -z "$(gofmt -l cmd internal)" test -z "$(gofmt -l cmd internal)"
go test -mod=readonly ./... go test -mod=readonly ./...
go build -mod=readonly -o bin/foundry ./cmd/foundry go build -mod=readonly -o bin/foundry ./cmd/foundry
- name: Verify configured Slack client credentials - name: Check Slack OAuth configuration and endpoint
if: gitea.event_name == 'push' if: gitea.event_name == 'push'
env: env:
SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }} SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }}
@@ -57,6 +57,10 @@ jobs:
if actual in ("invalid_code", "invalid_grant") and control in ("bad_client_secret", "invalid_client"): if actual in ("invalid_code", "invalid_grant") and control in ("bad_client_secret", "invalid_client"):
print("Slack client credentials accepted; invalid-secret negative control rejected") print("Slack client credentials accepted; invalid-secret negative control rejected")
print("A real user authorization is still required to verify the complete login") print("A real user authorization is still required to verify the complete login")
elif actual in ("invalid_code", "invalid_grant") and control in ("invalid_code", "invalid_grant"):
print("Both Slack Actions secrets are available and the OAuth endpoint is reachable")
print("Slack rejected the placeholder code before validating the client secret")
print("Client-secret validity requires a real user authorization; this is not a complete login test")
else: else:
known = {"invalid_client_id", "bad_client_secret", "invalid_client", "invalid_code", known = {"invalid_client_id", "bad_client_secret", "invalid_client", "invalid_code",
"invalid_grant", "bad_redirect_uri", "accesslimited", "ratelimited"} "invalid_grant", "bad_redirect_uri", "accesslimited", "ratelimited"}