Conversation
The Kong semgrep action spins up a fresh Python 3.12 via setup-python, so the previous `pip install setuptools` ran on an unrelated Python and the action still failed with ModuleNotFoundError: pkg_resources. Call setup-python with the same pinned version first so setuptools lands in the toolcache the action reuses.
The Kong public-shared-actions/semgrep action calls setup-python@v6 with python-version 3.12 and then pip installs semgrep. semgrep pulls in opentelemetry-instrumentation 0.46b0, which imports pkg_resources at load time - but Python 3.12 no longer ships setuptools by default, so semgrep ci crashes with ModuleNotFoundError. Replace the shared action with the same composite steps so we can pip install setuptools alongside semgrep. The artifact upload and SARIF upload steps are preserved with the same pinned SHAs as before.
setuptools 81 removed the pkg_resources module, but opentelemetry-instrumentation (a semgrep transitive dep) still imports it at load time. The previous attempt installed setuptools-82.0.1, which has no pkg_resources, so semgrep ci still crashed with ModuleNotFoundError. Pin to the pre-removal series.
Revert the inline rewrite and keep using the Kong shared semgrep action. The real fix is the setuptools version: 3.12 no longer bundles pkg_resources, and setuptools >=81 dropped the module entirely, so we must seed the toolcache with setuptools<81 before the action reuses Python 3.12.
xiaocang
approved these changes
Apr 20, 2026
chobits
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Kong semgrep action spins up a fresh Python 3.12 via setup-python, so the previous
pip install setuptoolsran on an unrelated Python and the action still failed with ModuleNotFoundError: pkg_resources.Call setup-python with the same pinned version first so setuptools lands in the toolcache the action reuses.