FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-pt-br/scripts/prepmsg.sh at main · python/python-docs-pt-br · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
python-docs-pt-br
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
41
Star
161
Code
Issues
13
Pull requests
4
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-pt-br
/
scripts
/
prepmsg.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
40 lines (33 loc) · 1.2 KB
Breadcrumbs
python-docs-pt-br
/
scripts
/
prepmsg.sh
Copy path
File metadata and controls
executable file
·
40 lines (33 loc) · 1.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!
/bin/bash
#
Prepare message for Telegram notification
set
-ex
die
() {
echo
"
$0
: error:
$*
"
>&2
;
exit
1
;
}
[
$#
-ne
2 ]
&&
die
"
Expected 1 input and 1 output files, got
$#
"
[
!
-f
"
$1
"
]
&&
die
"
Input file
$1
not found, skipping.
"
[
-z
"
${PYDOC_REPO}
"
]
&&
die
"
PYDOC_REPO is empty.
"
[
-z
"
${PYDOC_VERSION}
"
]
&&
die
"
PYDOC_VERSION is empty.
"
[
-z
"
${GITHUB_RUN_ID}
"
]
&&
die
"
GITHUB_RUN_ID is empty.
"
[
-z
"
${GITHUB_JOB}
"
]
&&
die
"
GITHUB_JOB is empty.
"
URL=
"
${PYDOC_REPO}
/actions/runs/
${GITHUB_RUN_ID}
"
input=
"
$1
"
output=
"
$2
"
touch aux
if
[[
"
${GITHUB_JOB}
"
==
"
build
"
]]
;
then
grep
'
cpython/Doc/.*WARNING:
'
"
$input
"
|
\
sed
'
s|.*/cpython/Doc/||
'
|
\
uniq
|
\
sed
'
s|^|```\n|;s|$|\n```\n|
'
\
>
aux
elif
[[
"
${GITHUB_JOB}
"
==
"
lint
"
]]
;
then
grep -P
'
^.*\.po:\d+:\s+.*\(.*\)$
'
"
$input
"
|
\
sed
'
s|.*/cpython/Doc/||
'
|
\
sort -u
|
\
sed
'
s|^|```\n|;s|$|\n```\n|
'
\
>
aux
else
die
"
Unexpected job name
${GITHUB_JOB}
"
fi
[[
$(
cat aux
)
==
"
"
]]
&&
die
"
Unexpected empty output message.
"
echo
"
❌ *
${PYDOC_VERSION}
${GITHUB_JOB}
* (ID [
${GITHUB_RUN_ID}
](
$URL
)):
"
>
"
$output
"
;
{
echo
"
"
;
cat aux
;
echo
"
"
;
}
>>
"
$output
"
rm aux
Back
|
FazBrowse Home
|
New Git URL