Skip to content

Commit 87be116

Browse files
authored
make the failure_notficiations action usable from the internal repo (#3428)
[static] Signed-off-by: Mateusz Błażejewski <[email protected]>
1 parent eb44304 commit 87be116

File tree

1 file changed

+7
-2
lines changed
  • .github/actions/tests/failure_notifications

1 file changed

+7
-2
lines changed

.github/actions/tests/failure_notifications/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ inputs:
2121
description: "Slack channel for notifications"
2222
required: true
2323

24-
2524
runs:
2625
using: "composite"
2726
steps:
@@ -42,4 +41,10 @@ runs:
4241
FAILURE_NOTIFICATIONS_URL: ${{ inputs.notifications_url }}
4342
NOTIFICATION_SLACK_CHANNEL: ${{ inputs.slack_channel }}
4443
shell: bash
45-
run: ./.github/actions/scripts/notification-scripts/failure_notification.py --job_subname "${{ inputs.job_subname }}"
44+
# on self-hosted runners all python packages are preinstalled but on github-hosted they will be missing
45+
run: |
46+
if [[ "${RUNNER_ENVIRONMENT}" != "self-hosted" ]]; then
47+
echo "Not a self-hosted runner. Installing required Python packages..."
48+
python3 -m pip install GitPython requests
49+
fi
50+
${GITHUB_ACTION_PATH}/../../scripts/notification-scripts/failure_notification.py --job_subname "${{ inputs.job_subname }}"

0 commit comments

Comments
 (0)