Skip to content

ci: pass GITHUB_TOKEN to stats script step#78

Open
nice2mitja wants to merge 1 commit into
SAP:masterfrom
nice2mitja:fix/pass-token-to-stats-script
Open

ci: pass GITHUB_TOKEN to stats script step#78
nice2mitja wants to merge 1 commit into
SAP:masterfrom
nice2mitja:fix/pass-token-to-stats-script

Conversation

@nice2mitja

Copy link
Copy Markdown
Member

Summary

Adds GITHUB_TOKEN as an env variable to the Python step that runs fetch_and_append_stats.py from the release_stats branch.

Why

The companion PR #77 (against release_stats) switches that script to GitHub's GraphQL API, which is the only way to work around the /repos/.../releases REST endpoint's hard ~1000-result pagination cap. The cap was causing the oldest releases (e.g. sapmachine-11.0.2 with 1.94 M downloads) to silently fall out of the snapshots.

GraphQL requires authentication. The workflow must therefore pass GITHUB_TOKEN to the script's environment.

Diff

    # 6. Run the Python script to fetch and append download stats
    - name: Run Python script to fetch and append download stats
+     env:
+       GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: python .github/scripts/fetch_and_append_stats.py

That's the entire change.

Merge order

This PR is forward-compatible with the current script (an unused env var is harmless), so it can be merged at any time — ideally before #77, so that when the script update lands the workflow already has the env var ready.

Related

The companion script .github/scripts/fetch_and_append_stats.py (which
lives on the release_stats branch) is being switched to GitHub's
GraphQL API in PR SAP#77 to work around the REST endpoint's 1000-release
pagination cap. GraphQL requires authentication, so the workflow needs
to pass GITHUB_TOKEN to the Python step as an env variable.

This change is independent of the script change itself and could be
merged before SAP#77 (extra env var on a script that doesn't read it is
harmless), making the cutover risk-free.
@nice2mitja nice2mitja requested a review from RealCLanger June 16, 2026 06:25
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.

2 participants