Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7efe95

Browse files
committed
fix premsg
1 parent aa591ef commit d7efe95

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ on:
66
push:
77
paths:
88
- '.github/workflows/build.yml'
9+
- '.github/scripts/build.sh'
10+
- '.github/scripts/prepmsg.sh'
911
- '*.po'
1012
- '**/*.po'
1113

1214
env:
13-
# CPython branch where translations currently take place
1415
CPYTHON_BRANCH: '3.10'
1516
LANGUAGE: 'pt_BR'
1617

@@ -56,9 +57,8 @@ jobs:
5657
path: cpython/Doc/build/html
5758
- name: Prepare error log for notification if it exists
5859
if: failure()
59-
shell: bash
6060
run: |
61-
sh scripts/setup-notif-message.sh error.log notify.log
61+
sh scripts/prepmsg.sh error.log notify.log
6262
env:
6363
GITHUB_JOB: ${GITHUB_JOB}
6464
GITHUB_RUN_NUMBER: ${GITHUB_RUN_NUMBER}
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#!/bin/sh
2-
# Prepare message for Telegram notification
3-
4-
set -e
5-
Set -x
6-
7-
[ $# -ne 2 ] && ( echo "Expected 1 input and 1 output files, got $#."; exit; )0
8-
[ ! -f $1 ] && ( echo "Input file $1 not found, skipping."; exit; )
9-
10-
URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_NUMBER}"
11-
12-
echo "❌ *${GITHUB_JOB}* ([ID *${GITHUB_RUN_NUMBER}*]($URL)):" > $2
13-
grep 'cpython/Doc/.*WARNING:' $1 | sed 's|.*/cpython/Doc|Doc|' | uniq >> $2
1+
#!/bin/sh
2+
# Prepare message for Telegram notification
3+
set -ex
4+
5+
[ $# -ne 2 ] && ( echo "Expected 1 input and 1 output files, got $#"; exit; )
6+
[ ! -f $1 ] && ( echo "Input file $1 not found, skipping."; exit; )
7+
for var in GITHUB_REPOSITORY GITHUB_RUN_NUMBER GITHUB_JOB; do
8+
[ -z ${!var} ] && ( echo "${!var} is empty."; exit 1; )
9+
done
10+
11+
URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_NUMBER}"
12+
echo "❌ *${GITHUB_JOB}* ([ID *${GITHUB_RUN_NUMBER}*]($URL)):" > $2
13+
echo "" >> $2
14+
grep 'cpython/Doc/.*WARNING:' $1 | sed 's|.*/cpython/Doc|Doc|' | uniq >> $2

0 commit comments

Comments
 (0)