|
42 | 42 | curl -s https://api.github.com/repos/tarantool/tarantool/actions/runs/${{ github.run_id }}/jobs | jq -r '.jobs[0].id' | tee -a $GITHUB_ENV
|
43 | 43 | echo 'EOF' >> $GITHUB_ENV
|
44 | 44 | shell: bash
|
| 45 | + # convert commit message to single line with marked new lines as 'TELEGRAMNEWLINE' |
| 46 | + - env: |
| 47 | + COMMIT_MSG: | |
| 48 | + ${{ github.event.head_commit.message }} |
| 49 | + run: | |
| 50 | + # Make changes in the commit message to avoid of its fail on Markdown: |
| 51 | + # 1. Convert message from multi lines to single line. |
| 52 | + # 2. Add backslashes to single quote marks in message. |
| 53 | + # 3. Add backslashes to '`' in message. |
| 54 | + if ${{ env.OS_IS_FEDORA_OR_RHEL == 'true' }} || ${{ env.KERNEL_NAME == 'Darwin' }} ; then |
| 55 | + msg="${COMMIT_MSG//$'\n'/TELEGRAMNEWLINE}" |
| 56 | + msg="${msg//$'\\\\'/BACKSLASH}" |
| 57 | + msg="${msg//$'\\\''/\'}" |
| 58 | + msg="${msg//$'\`'/BACKTICK}" |
| 59 | + else |
| 60 | + msg="${COMMIT_MSG//$'\n'/TELEGRAMNEWLINE}" |
| 61 | + msg="${msg//$'\\'/BACKSLASH}" |
| 62 | + msg="${msg//$'\''/\\\'}" |
| 63 | + msg="${msg//$'`'/BACKTICK}" |
| 64 | + fi |
| 65 | + echo 'COMMIT_MSG_LINE<<EOF' >> $GITHUB_ENV |
| 66 | + echo "$msg" | tee -a $GITHUB_ENV |
| 67 | + echo 'EOF' >> $GITHUB_ENV |
| 68 | + shell: bash |
| 69 | + # strip Markdown from commit message |
| 70 | + - run: | |
| 71 | + pip3 install setuptools |
| 72 | + pip3 install markdown bs4 |
| 73 | + echo "Sending commit message part as a single line: ${{ env.COMMIT_MSG_LINE }}" |
| 74 | + msg=`python3 -c "import markdown ; \\ |
| 75 | + from bs4 import BeautifulSoup ; \\ |
| 76 | + md = markdown.markdown(\"${{ env.COMMIT_MSG_LINE }}\") ; \\ |
| 77 | + soup = BeautifulSoup(md, features='html.parser') ; \\ |
| 78 | + print(soup.get_text())"` |
| 79 | + echo "Sending commit message part as a single line: $msg" |
| 80 | + echo 'COMMIT_MSG<<EOF' >> $GITHUB_ENV |
| 81 | + if ${{ env.OS_IS_FEDORA_OR_RHEL == 'true' }} || ${{ env.KERNEL_NAME == 'Darwin' }} ; then |
| 82 | + echo $msg | sed "s#TELEGRAMNEWLINE#\\\n#g" | tee -a $GITHUB_ENV |
| 83 | + else |
| 84 | + echo $msg | sed "s#TELEGRAMNEWLINE#\n#g" | tee -a $GITHUB_ENV |
| 85 | + fi |
| 86 | + echo 'EOF' >> $GITHUB_ENV |
| 87 | + shell: bash |
45 | 88 | - env:
|
46 | 89 | MSG: |
|
47 | 90 | 🔴 Workflow testing failed:
|
|
54 | 97 | Committer: `${{ github.actor }}`
|
55 | 98 | ```
|
56 | 99 | ---------------- Commit message -------------------
|
57 |
| - ${{ github.event.head_commit.message }} |
| 100 | + ${{ env.COMMIT_MSG }} |
58 | 101 | ```
|
59 | 102 | run: |
|
60 | 103 | # convert message from multi lines to single line and
|
|
0 commit comments