Skip to content

GHA-219 Fix notify-slack failing on runners without system Python#127

Merged
nils-werner-sonarsource merged 1 commit intomasterfrom
nw/gha-219-fix-notify-slack-python
Mar 24, 2026
Merged

GHA-219 Fix notify-slack failing on runners without system Python#127
nils-werner-sonarsource merged 1 commit intomasterfrom
nw/gha-219-fix-notify-slack-python

Conversation

@nils-werner-sonarsource
Copy link
Contributor

Summary

  • Adds a Set up Python step (pinned actions/setup-python@v5.6.0) to notify-slack/action.yml
  • Creates a venv in the action directory and installs dependencies into it
  • Uses the venv's python and pip executables throughout

Context

GHA-219 PR #125 replaced the Docker-based Slack notifier with a Python script. However, the action relied on the system python binary (not present on newer GitHub runners) and bare pip install (blocked by PEP 668 on Debian-based runners that enforce the externally-managed-environment restriction).

Using setup-python + a venv makes the action fully self-contained and runner-agnostic.

Fixes: https://sonarsource.atlassian.net/browse/GHA-219

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 23, 2026

Summary

Fixes the notify-slack action to work on modern GitHub runners by adding an explicit setup-python step and installing dependencies into a local venv. This replaces reliance on unavailable system Python and works around PEP 668 restrictions that prevent bare pip install on runner images.

What reviewers should know

Review focus: verify the venv setup is complete (check that both pip install and python execution use the venv binaries). The solution is straightforward — the pinned setup-python version is good for reproducibility, and the .venv/bin/ paths are consistent throughout. Worth confirming that .venv is appropriately ignored in git or .gitignore (though it's recreated each workflow run). The Python 3.10 version choice is reasonable; check if it aligns with any stated minimum version requirement for the notify_slack.py script.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Mar 23, 2026

GHA-219

@sonarqubecloud
Copy link

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

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

Conclusion: Clean, minimal fix — the venv is created and consumed consistently, the SHA pin follows repo convention, and the change is fully self-contained.

🗣️ Give feedback

@nils-werner-sonarsource nils-werner-sonarsource merged commit 2d944d5 into master Mar 24, 2026
9 checks passed
@nils-werner-sonarsource nils-werner-sonarsource deleted the nw/gha-219-fix-notify-slack-python branch March 24, 2026 08:08
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