Skip to content
Snippets Groups Projects
Commit c19dcdc4 authored by Alexander V. Tikhonov's avatar Alexander V. Tikhonov Committed by Kirill Yukhin
Browse files

github-ci: fix message send on rhel/fedora hosts

Found that on self-hosted runners where CentOS 7 is the base OS,
'send-telegram-notify' action creates message with syntax error:

  --------------'\n't'\n'```'\n'')) ; \
  ^
  SyntaxError: unexpected character after line continuation character

It happened because of extra quotes at '\n' while it had to be \n.
To avoid of it the same message changes must be done as for OSX
hosts are doing. These changes should be done when self-hosted
runners uses RHEL or Fedora as base OS.
parent 432edce1
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,12 @@ runs:
uname -s | tee -a $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
shell: bash
# check if host OS is rhel or fedora
- run: |
echo 'OS_IS_FEDORA_OR_RHEL<<EOF' >> $GITHUB_ENV
grep "^ID=" /etc/os-release | grep -e 'centos' -e 'fedora' && echo true | tee -a $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
shell: bash
# get job id number
- run: |
sudo -n apt update -y ||:
......@@ -53,7 +59,7 @@ runs:
run: |
# convert message from multi lines to single line and
# add backslashes to single quote marks in message
if ${{ env.KERNEL_NAME == 'Darwin' }} ; then
if ${{ env.OS_IS_FEDORA_OR_RHEL == 'true' }} || ${{ env.KERNEL_NAME == 'Darwin' }} ; then
msg="${MSG//$'\n'/\n}"
msg="${msg//$'\\\''/\'}"
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment