Skip to content

Commit 2d944d5

Browse files
GHA-219 Fix notify-slack failing on runners without system Python (#127)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5e7da9e commit 2d944d5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

notify-slack/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ runs:
4444
with:
4545
secrets: |
4646
development/kv/data/slack token | SLACK_TOKEN;
47+
- name: Set up Python
48+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
49+
with:
50+
python-version: '3.10'
4751
- name: Install dependencies
4852
shell: bash
49-
run: pip install -r "$GITHUB_ACTION_PATH/requirements.txt" --quiet
53+
run: |
54+
python3 -m venv "$GITHUB_ACTION_PATH/.venv"
55+
"$GITHUB_ACTION_PATH/.venv/bin/pip" install -r "$GITHUB_ACTION_PATH/requirements.txt" --quiet
5056
- name: Send Slack Notification
5157
shell: bash
5258
env:
@@ -57,7 +63,7 @@ runs:
5763
INPUT_COLOR: ${{ inputs.color }}
5864
INPUT_MESSAGE: ${{ inputs.message != '' && inputs.message || format('*Run:* {0}/{1}/actions/runs/{2}\n*Failed Jobs:* {3}', github.server_url, github.repository, github.run_id, steps.collect_failed_jobs.outputs.failed-jobs) }}
5965
run: |
60-
python "$GITHUB_ACTION_PATH/notify_slack.py" \
66+
"$GITHUB_ACTION_PATH/.venv/bin/python" "$GITHUB_ACTION_PATH/notify_slack.py" \
6167
--channel "$INPUT_CHANNEL" \
6268
--project-name "$INPUT_PROJECT_NAME" \
6369
--icon "$INPUT_ICON" \

0 commit comments

Comments
 (0)