Skip to content

Commit f48f1d4

Browse files
committed
ci: diagnose GitHub provenance authentication
1 parent 79316c6 commit f48f1d4

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎Jenkinsfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ pipeline {
4747
sh '''
4848
set -eu
4949
export PATH="$WORKSPACE/.ci-venv/bin:$PATH"
50+
gh api user --jq .login >/dev/null
51+
gh api rate_limit --jq '.resources.core | "GitHub API rate limit: \(.remaining)/\(.limit) remaining"'
5052
scripts/license-gate.sh --selftest
5153
scripts/license-gate.sh
5254
scripts/audit-license-provenance.py

‎scripts/audit-license-provenance.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def gh_api(path):
7575
"""Fetch one GitHub API path once per audit process."""
7676
r = subprocess.run(["gh", "api", path], capture_output=True, text=True)
7777
if r.returncode != 0:
78+
detail = r.stderr.strip().replace("\n", " ")
79+
print(f"GitHub API request failed ({path}): {detail}", file=sys.stderr)
7880
return None
7981
return r.stdout
8082

0 commit comments

Comments
 (0)